2025-01-10 16:43:03 +00:00
|
|
|
# Update at the start (we don't know if file changed)
|
|
|
|
git add *
|
|
|
|
git commit -m 'sync'
|
|
|
|
git push
|
|
|
|
|
|
|
|
while true
|
|
|
|
do
|
|
|
|
#last_changed=$(find . -mmin -1)
|
|
|
|
# Update if file changed 10 seconds ago
|
2025-01-10 17:20:36 +00:00
|
|
|
last_changed=$(find . -newermt "10 seconds ago" | grep -v .git)
|
2025-01-10 16:43:03 +00:00
|
|
|
if [ "$last_changed" != "" ]; then
|
|
|
|
git add *
|
|
|
|
git commit -m 'sync'
|
|
|
|
git push
|
|
|
|
fi
|
|
|
|
sleep 5
|
|
|
|
done
|