diff --git a/bashrc.sh b/bashrc.sh index 22232fb..142ccd5 100644 --- a/bashrc.sh +++ b/bashrc.sh @@ -108,11 +108,14 @@ alias code-check="check-code" # Quickly commit code to a repo. function commit { message="$1" - if [[ -z $message ]]; then + if [[ -z "$message" ]]; then echo "ERROR: A message is required." >&2 echo 'USAGE: commit "My commit message."' >&2 return 1 fi + if [[ "$1" == "-m" ]]; then + message="$2" + fi git add . && git commit -m "$message" && git push } @@ -535,3 +538,4 @@ alias prod-pull="pull_prod_backups" PROG="$(basename -- "${BASH_SOURCE[0]}")" echo "'$PROG' completed!" leted!" +d!"