diff --git a/git_automation.sh b/git_automation.sh index 09ed251..c2f3107 100755 --- a/git_automation.sh +++ b/git_automation.sh @@ -16,11 +16,23 @@ echo "PLEASE make sure that you have a good .gitignore file set up to avoid comm while true; do if [[ -f "$TRIGGER_FILE" ]]; then rm -f "$TRIGGER_FILE" + echo "[INFO] Triggered at $(date)" + + # Prompt the user for a commit message + read -rp "Enter commit message: " COMMIT_MSG + # Fallback if the user presses enter without typing a message + if [[ -z "$COMMIT_MSG" ]]; then + COMMIT_MSG="Committed" + fi + + # Run Git commands git status git add . - git commit -m "Committed" + git commit -m "$COMMIT_MSG" git push + + echo "[INFO] Git commands completed at $(date)" fi sleep 0.5 done