Files
myscripts/git-build-init.sh
2019-02-21 23:26:35 +01:00

31 lines
955 B
Bash
Executable File

#!/bin/sh
read -p "Set build branch prefix [build]:" BUILD_BRANCH_PREFIX
BUILD_BRANCH_PREFIX="${BUILD_BRANCH_PREFIX:=build}"
git config --local build.branch.prefix $BUILD_BRANCH_PREFIX
echo
echo
read -p "Set build commit messages [build from \$(date --utc)]:" BUILD_COMMIT_MSG
BUILD_COMMIT_MSG=${BUILD_COMMIT_MSG:='build from $(date --utc)'}
git config --local build.commit.messages "$BUILD_COMMIT_MSG"
echo
echo
read -p "Add remote build repo[false]:" BUILD_REMOTE_ENABLE
BUILD_REMOTE_ENABLE="${BUILD_REMOTE_ENABLE:=false}"
git config --local build.remote.enable $BUILD_REMOTE_ENABLE
echo
echo
if [ "$BUILD_REMOTE_ENABLE" == "true" ]; then
read -p "Set build remote name [build]:" BUILD_REMOTE_NAME
BUILD_REMOTE_NAME="${BUILD_REMOTE_NAME:=build}"
git config --local build.remote.name $BUILD_REMOTE_NAME
echo
echo
read -p "Set build remote url:" BUILD_REMOTE_URL
git remote add "$BUILD_REMOTE_NAME" "$BUILD_REMOTE_URL"
fi