add git build init command

This commit is contained in:
stubbfelnewpc
2019-02-21 22:52:44 +01:00
parent 0b50caaa0d
commit 60cd5dc072
2 changed files with 39 additions and 3 deletions

View File

@@ -1,4 +1,10 @@
#!/bin/sh
COMMAND=$1
if [ "$COMMAND" == "init" ]; then
./git-build-init.sh
exit
fi
ORIGIN_BRANCH_NAME=$(git symbolic-ref HEAD | sed 's!refs\/heads\/!!'| sed 's!build\/!!')
BUILD_COMMIT_MSG=$(git config --default "build from $(date --utc)" --get build.commit.messages)
BUILD_BRANCH_PREFIX=$(git config --default "build" --get build.branch.prefix)
@@ -8,8 +14,8 @@ BUILD_BRANCH_NAME="$BUILD_BRANCH_PREFIX/$ORIGIN_BRANCH_NAME"
git checkout -B $BUILD_BRANCH_NAME
git add --all
git commit -m "$BUILD_COMMIT_MSG"
git commit -m "$(eval echo $BUILD_COMMIT_MSG)"
if [ "$BUILD_REMOTE_ENABLE" == "true" ]; then
git push --set-upstream $BUILD_REMOTE_NAME $BUILD_BRANCH_NAME
fi
git push $BUILD_REMOTE_NAME $BUILD_BRANCH_NAME
fi