echo -e "''${RED}==> ✖ Cancelled.''${RESET}" | tee -a $LOGFILE
# echo -e "''${RED}==> ✖ Cancelled.''${RESET}" | tee -a $LOGFILE
printLogfileAndExit -1
# printLogfileAndExit -1
}
# }
#
# Function for unified logging and display
# # Function for unified logging and display
log_action() {
# log_action() {
if [ $? -eq 0 ]; then
# if [ $? -eq 0 ]; then
echo -e " ''${GREEN}✔''${RESET} $1: Successful" | tee -a $LOGFILE
# echo -e " ''${GREEN}✔''${RESET} $1: Successful" | tee -a $LOGFILE
else
# else
echo -e " ''${RED}✖''${RESET} $1: Failed" | tee -a $LOGFILE
# echo -e " ''${RED}✖''${RESET} $1: Failed" | tee -a $LOGFILE
printLogfileAndExit 1
# printLogfileAndExit 1
fi
# fi
}
# }
#
print_what_to_do() {
# print_what_to_do() {
echo -e "\n\nWhat do you want to do?\n"
# echo -e "\n\nWhat do you want to do?\n"
}
# }
#
git_status=$(git status --porcelain)
# git_status=$(git status --porcelain)
if [[ -z "$git_status" ]]; then
# if [[ -z "$git_status" ]]; then
log_error_and_display "No changes to commit. Exiting."
# log_error_and_display "No changes to commit. Exiting."
printLogfileAndExit 0
# printLogfileAndExit 0
fi
# fi
#
print_headline "Choose commit type"
# print_headline "Choose commit type"
selection=$(gum choose "feat: (new feature for the user, not a new feature for build script)" "fix: (bug fix for the user, not a fix to a build script)" "chore: (updating grunt tasks etc.; no production code change)" "docs: (changes to the documentation)" "style: (formatting, missing semi colons, etc; no production code change)" "refactor: (refactoring production code, eg. renaming a variable)" "test: (adding missing tests, refactoring tests; no production code change)" "Cancel")
# selection=$(gum choose "feat: (new feature for the user, not a new feature for build script)" "fix: (bug fix for the user, not a fix to a build script)" "chore: (updating grunt tasks etc.; no production code change)" "docs: (changes to the documentation)" "style: (formatting, missing semi colons, etc; no production code change)" "refactor: (refactoring production code, eg. renaming a variable)" "test: (adding missing tests, refactoring tests; no production code change)" "Cancel")