add: sync-up.sh — push live hermes config to repo

The harness is the source. The repo is the record.
Changes flow UP from ~/.hermes, not down from the repo.
This commit is contained in:
Alexander Whitestone
2026-03-25 19:11:31 -04:00
parent a55b9ad8ae
commit 069f8bd55f

42
bin/sync-up.sh Executable file
View File

@@ -0,0 +1,42 @@
#!/usr/bin/env bash
# sync-up.sh — Push live ~/.hermes config changes UP to timmy-config repo.
# The harness is the source. The repo is the record.
# Run periodically or after significant config changes.
set -euo pipefail
REPO_DIR="$HOME/.timmy/timmy-config"
HERMES_HOME="$HOME/.hermes"
log() { echo "[sync-up] $*"; }
# === Copy live config into repo ===
cp "$HERMES_HOME/config.yaml" "$REPO_DIR/config.yaml"
log "config.yaml"
# === Playbooks ===
for f in "$HERMES_HOME"/playbooks/*.yaml; do
[ -f "$f" ] && cp "$f" "$REPO_DIR/playbooks/"
done
log "playbooks/"
# === Skins ===
for f in "$HERMES_HOME"/skins/*; do
[ -f "$f" ] && cp "$f" "$REPO_DIR/skins/"
done
log "skins/"
# === Channel directory ===
[ -f "$HERMES_HOME/channel_directory.json" ] && cp "$HERMES_HOME/channel_directory.json" "$REPO_DIR/"
log "channel_directory.json"
# === Commit and push if there are changes ===
cd "$REPO_DIR"
if [ -n "$(git status --porcelain)" ]; then
git add -A
git commit -m "sync: live config from ~/.hermes $(date +%Y-%m-%d_%H:%M)"
git push
log "Pushed changes to Gitea."
else
log "No changes to sync."
fi