1
0
Fork 0

feat(scripts): add project create and sync scripts (fixes #7)

This commit is contained in:
ssube 2019-09-18 18:43:01 -05:00
parent 69ec771aa0
commit 79bc4993bf
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
3 changed files with 30 additions and 0 deletions

17
scripts/project-create.sh Executable file
View File

@ -0,0 +1,17 @@
#! /bin/bash
PROJECT_NAME="${1}"
PROJECT_PATH="${2:-${USER}}"
echo "Creating project ${PROJECT_NAME}..."
mkdir ../"${PROJECT_NAME}"
pushd ../"${PROJECT_NAME}"
echo "Setting up repository..."
git init
git remote add github git@github.com:${PROJECT_PATH}/${PROJECT_NAME}.git
git remote add gitlab git@git.apextoaster.com:${PROJECT_PATH}/${PROJECT_NAME}.git
echo "Setting up template..."
popd
./scripts/project-update.sh "../${PROJECT_NAME}"

3
scripts/project-exclude Normal file
View File

@ -0,0 +1,3 @@
docs/api/
src/app.ts
test/TestApp.ts

10
scripts/project-update.sh Executable file
View File

@ -0,0 +1,10 @@
#! /bin/bash
set -x
PROJECT_NAME="${1}"
echo "Updating project: ${PROJECT_NAME}"
git ls-tree -r HEAD --name-only | rsync -avh \
--files-from=- \
--exclude-from=./scripts/project-exclude \
./ "${PROJECT_NAME}"