Compare commits

..

10 Commits

Author SHA1 Message Date
0321e977b4 Merge pull request 'dev' (#1) from dev into main
Reviewed-on: #1
2025-12-23 15:55:36 +00:00
5e68ab0ee4 Committed 2025-12-23 15:54:48 +00:00
1be8442480 Committed 2025-12-23 15:52:12 +00:00
fce0e286d5 Committed 2025-12-23 15:50:59 +00:00
c21e077780 Committed 2025-12-23 15:50:21 +00:00
6da42bd82d Committed 2025-12-23 15:49:34 +00:00
4056e5eefa Committed 2025-12-23 15:48:32 +00:00
fe52d8a081 Committed 2025-12-23 15:46:58 +00:00
c675e1f1a1 Committed 2025-12-23 15:44:40 +00:00
c22686e1dd Committed 2025-12-23 15:29:57 +00:00

43
git_automation.sh Executable file
View File

@@ -0,0 +1,43 @@
#!/bin/bash
#Before running this script, make sure that you added an alias to your shell config file (~/.bashrc, ~/.zshrc, etc.)
#alias trigger_git='touch /tmp/please_update'
#Then run source ~/.zshrc to load the new alias
#Variable to store the trigger file path
TRIGGER_FILE="/tmp/please_update"
#The magic itself
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
rm -f "$TRIGGER_FILE"
echo "[INFO] Triggered at $(date)"
# 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 "$DEFAULT_COMMIT_MSG"
sleep 0.5
git push
echo "[INFO] Git commands completed at $(date)"
fi
sleep 0.5
done