dnes: trigger auto-sync to konzdat on each entry via post-commit hook

This commit is contained in:
2026-11-05 23:27:16 +01:00
parent 4d62a93e7b
commit d5df724dd2
2 changed files with 43 additions and 0 deletions
+10
View File
@@ -44,6 +44,16 @@ cmd_done() {
echo "- [$time_now] $text" >> "$JOURNAL_FILE"
echo "Logged to journal: [$time_now] $text"
# Git checkpoint to trigger post-commit hook for Konzdat update
(
cd "$PLAN_DIR"
git add "$JOURNAL_FILE" 2>/dev/null || true
if ! git diff-index --quiet HEAD -- 2>/dev/null; then
git commit -m "dnes: $text" >/dev/null 2>&1 || true
git push origin main >/dev/null 2>&1 || true
fi
) &
# Trigger Syncthing rescan so peers receive the entry immediately
local api_key
api_key=$(grep -oPm1 "(?<=<apikey>)[^<]+" "$HOME/.config/syncthing/config.xml" 2>/dev/null || true)