about summary refs log tree commit diff stats
path: root/hm
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-10-20 23:24:37 +0200
committerSoispha <soispha@vhack.eu>2023-10-20 23:24:37 +0200
commitba3b25b662c3e024d32eb84439e2552781a37194 (patch)
tree860cf7740a97453cb4571527016530882dc3f036 /hm
parentfix(hm/pkgs/scr/neorg): Add cocogitto and git-crypt as dependencies (diff)
downloadnixos-config-ba3b25b662c3e024d32eb84439e2552781a37194.tar.gz
nixos-config-ba3b25b662c3e024d32eb84439e2552781a37194.zip
fix(hm/pkgs/src/neorg): Only commit when something has changed
Diffstat (limited to '')
-rwxr-xr-xhm/soispha/pkgs/scripts/wrappers/neorg5
1 files changed, 4 insertions, 1 deletions
diff --git a/hm/soispha/pkgs/scripts/wrappers/neorg b/hm/soispha/pkgs/scripts/wrappers/neorg
index f34b20b8..48195eb1 100755
--- a/hm/soispha/pkgs/scripts/wrappers/neorg
+++ b/hm/soispha/pkgs/scripts/wrappers/neorg
@@ -150,7 +150,10 @@ ADD_open_taskwarrior_project_file() {
 
     base_task_project_file_path="$(awk "{ gsub(\"$git_dir/\", \"\", \$0); print }" "$(ptmp "$task_project_file")")"
     git add $task_project_file;
-    git commit --verbose --message="chore($(dirname "$base_task_project_file_path")): Update"
+    if ! [ "$(git status --porcelain=v2 | awk '{print $2}' | head -c 1)" = "." ]; then
+        # TODO: Also check that only our file is staged before committing <2023-10-20>
+        git commit --verbose --message="chore($(dirname "$base_task_project_file_path")): Update"
+    fi
 }
 # }}}