dev #1
@@ -12,6 +12,7 @@ echo "[INFO] Watching $TRIGGER_FILE..."
|
||||
echo "[INFO] To trigger a git commit and push, run: trigger_git"
|
||||
echo "PLEASE make sure that you have a good .gitignore file set up to avoid committing unwanted files."
|
||||
|
||||
DEFAULT_COMMIT_MSG="Committed"
|
||||
#Do not know if the runs forrever loop is the best way to do this but it works
|
||||
while true; do
|
||||
if [[ -f "$TRIGGER_FILE" ]]; then
|
||||
@@ -19,17 +20,18 @@ while true; do
|
||||
|
||||
echo "[INFO] Triggered at $(date)"
|
||||
|
||||
read -rp "Enter commit message: " COMMIT_MSG </dev/tty
|
||||
if [[ -z "$COMMIT_MSG" ]]; then
|
||||
COMMIT_MSG="Committed"
|
||||
fi
|
||||
# For some reason this is buggy as hell and does not work as espected...
|
||||
# read -rp "Enter commit message: " COMMIT_MSG </dev/tty
|
||||
# if [[ -z "$COMMIT_MSG" ]]; then
|
||||
# COMMIT_MSG="Committed"
|
||||
# fi
|
||||
|
||||
# Run Git commands
|
||||
git status
|
||||
sleep 0.5
|
||||
git add .
|
||||
sleep 0.5
|
||||
git commit -m "$COMMIT_MSG"
|
||||
git commit -m "$DEFAULT_COMMIT_MSG"
|
||||
sleep 0.5
|
||||
git push
|
||||
|
||||
|
||||
Reference in New Issue
Block a user