summaryrefslogtreecommitdiff
path: root/.zk/commit.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-x.zk/commit.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/.zk/commit.sh b/.zk/commit.sh
new file mode 100755
index 0000000..55dace9
--- /dev/null
+++ b/.zk/commit.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+grep $(date -I) <(git log -1) >/dev/null
+if [ $? -eq 0 ]; then
+ # Committed today already
+ git add -A
+ git commit --amend --reset-author --no-edit
+else
+ # New commit today
+ git add -A
+ git commit -m "snapshot: $(date -I)"
+fi