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