Skip to content

Commit 286ee29

Browse files
committed
updating git-build.sh
1 parent 36c2b44 commit 286ee29

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

git-build.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,23 @@ if [ $# -eq 2 ]; then
8888
printf -- '\033[32m [Git Commit]: [FINISHED] without errors. \033[0m\n'
8989
else
9090
GIT_COMMIT_MSG="[Git Commit]: at $(date --rfc-3339=seconds)"
91-
echo "[Git Message]: ${GIT_COMMIT_MSG}"
92-
git commit -m "${GIT_COMMIT_MSG}" || printf -- '\033[31m [EXIT] with status code %s.\033[0m\n' ${ERROR_CODE:-1} || exit 1
91+
echo "[Auto]: Setting GIT_COMMIT_MSG to ${GIT_COMMIT_MSG}"
9392
printf -- '\033[32m [Git Commit]: [FINISHED] without errors. \033[0m\n'
9493
fi
9594

9695
if [ -d "${GIT_LOCAL_PATH}" ]; then
9796
cd "${GIT_LOCAL_PATH}" || echo "Current Dir: $PWD" || exit 2
9897
printf -- '\033[32m [SUCCESS]: %s \033[0m\n' "${GIT_LOCAL_PATH}"
99-
git add . || echo || exit 1
98+
99+
### Setup for commit.
100+
git add . || echo || exit 1
100101
printf -- '\033[32m [SUCCESS]: git add . \033[0m\n'
101-
### Push and build the repository
102+
103+
### Commit changes.
104+
git commit -m "${GIT_COMMIT_MSG}" || printf -- '\033[31m [EXIT] with status code %s.\033[0m\n' ${ERROR_CODE:-1} || exit 1
105+
printf -- '\033[32m [SUCCESS]: git commit -m \033[0m\n'
106+
107+
### Push code to Repository
102108
git push origin master || printf -- '\033[31m [EXIT] with status code %s.\033[0m\n' ${ERROR_CODE:-1} || exit 1
103-
printf -- '\033[32m [SUCCESS]: git push origin master \033[0m\n'
109+
printf -- '\033[32m [SUCCESS]: git push origin master \033[0m\n'
104110
fi

0 commit comments

Comments
 (0)