Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/services/flask/email-messager/git_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down