summaryrefslogtreecommitdiff
path: root/.a/git-autocommit.sh
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2022-08-04 17:41:27 +0300
committerSyndamia <kamen@syndamia.com>2022-08-04 17:41:27 +0300
commit80b4c81b618d4e75b301ac1dd5adfb47f91deca7 (patch)
treebc7d94935b273a1aa9b1a1b69c2bbc853c8a32e7 /.a/git-autocommit.sh
parenta47706a5bd5ee5be16e3fe443b6008cac9ee741d (diff)
downloaddotfiles-80b4c81b618d4e75b301ac1dd5adfb47f91deca7.tar
dotfiles-80b4c81b618d4e75b301ac1dd5adfb47f91deca7.tar.gz
dotfiles-80b4c81b618d4e75b301ac1dd5adfb47f91deca7.zip
Moved a lot of stuff to a new folder called .a
Diffstat (limited to '.a/git-autocommit.sh')
-rwxr-xr-x.a/git-autocommit.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/.a/git-autocommit.sh b/.a/git-autocommit.sh
new file mode 100755
index 0000000..f969509
--- /dev/null
+++ b/.a/git-autocommit.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+TIME_SCALE=60 # In seconds
+TIME_INTERVAL=5 # Multiplier of TIME_SCALE
+
+
+ACCUMULATOR=0
+while true; do
+ if ! ((ACCUMULATOR % TIME_INTERVAL)) && [[ `git status --porcelain` ]]; then
+ MSG="Autocommit at $(date +'%d.%m.%Y @ %H:%M')"
+
+ git add . && git commit -m "$MSG" && git push
+
+ echo $MSG
+ fi
+
+ sleep $TIME_SCALE
+ ((ACCUMULATOR++))
+done