From 069f8bd55fbed9f035b66f52cba85b87cb4971c2 Mon Sep 17 00:00:00 2001 From: Alexander Whitestone Date: Wed, 25 Mar 2026 19:11:31 -0400 Subject: [PATCH] =?UTF-8?q?add:=20sync-up.sh=20=E2=80=94=20push=20live=20h?= =?UTF-8?q?ermes=20config=20to=20repo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The harness is the source. The repo is the record. Changes flow UP from ~/.hermes, not down from the repo. --- bin/sync-up.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 bin/sync-up.sh diff --git a/bin/sync-up.sh b/bin/sync-up.sh new file mode 100755 index 00000000..a6ce778b --- /dev/null +++ b/bin/sync-up.sh @@ -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