diff --git a/src/services/flask/email-messager/git_push.sh b/src/services/flask/email-messager/git_push.sh index 160f6f2..047f2f7 100644 --- a/src/services/flask/email-messager/git_push.sh +++ b/src/services/flask/email-messager/git_push.sh @@ -6,18 +6,21 @@ git_user_id=$1 git_repo_id=$2 release_note=$3 - -if [ "$git_user_id" = "" ]; then +############################################################################################## +# The -z flag causes test to check whether a string is empty.[remove this after merging pull]# +############################################################################################## +# Thx me later๐Ÿ˜Š๐Ÿ˜Š +if [ -z ${git_user_id} ]; then git_user_id="GIT_USER_ID" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" fi -if [ "$git_repo_id" = "" ]; then +if [ -z ${git_repo_id} ]; then git_repo_id="GIT_REPO_ID" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" fi -if [ "$release_note" = "" ]; then +if [ -z ${release_note} ]; then release_note="Minor update" echo "[INFO] No command line input provided. Set \$release_note to $release_note" fi @@ -33,9 +36,9 @@ git commit -m "$release_note" # Sets the new remote git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined +if [ -z ${git_remote} ]; then # git remote not defined - if [ "$GIT_TOKEN" = "" ]; then + if [ -z ${GIT_TOKEN} ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else