config: update bin/sync-up.sh,channel_directory.json

This commit is contained in:
Alexander Whitestone
2026-03-26 08:00:46 -04:00
parent e66f97a761
commit 56364e62b4
2 changed files with 14 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# sync-up.sh — Push live ~/.hermes config changes UP to timmy-config repo. # sync-up.sh — Push live ~/.hermes config changes UP to timmy-config repo.
# The harness is the source. The repo is the record. # The harness is the source. The repo is the record.
# Run periodically or after significant config changes. # Only commits when there are REAL changes (not empty syncs).
set -euo pipefail set -euo pipefail
@@ -12,31 +12,29 @@ log() { echo "[sync-up] $*"; }
# === Copy live config into repo === # === Copy live config into repo ===
cp "$HERMES_HOME/config.yaml" "$REPO_DIR/config.yaml" cp "$HERMES_HOME/config.yaml" "$REPO_DIR/config.yaml"
log "config.yaml"
# === Playbooks ===
for f in "$HERMES_HOME"/playbooks/*.yaml; do for f in "$HERMES_HOME"/playbooks/*.yaml; do
[ -f "$f" ] && cp "$f" "$REPO_DIR/playbooks/" [ -f "$f" ] && cp "$f" "$REPO_DIR/playbooks/"
done done
log "playbooks/"
# === Skins ===
for f in "$HERMES_HOME"/skins/*; do for f in "$HERMES_HOME"/skins/*; do
[ -f "$f" ] && cp "$f" "$REPO_DIR/skins/" [ -f "$f" ] && cp "$f" "$REPO_DIR/skins/"
done done
log "skins/"
# === Channel directory ===
[ -f "$HERMES_HOME/channel_directory.json" ] && cp "$HERMES_HOME/channel_directory.json" "$REPO_DIR/" [ -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 === # === Only commit if there are real diffs ===
cd "$REPO_DIR" cd "$REPO_DIR"
if [ -n "$(git status --porcelain)" ]; then git add -A
git add -A
git commit -m "sync: live config from ~/.hermes $(date +%Y-%m-%d_%H:%M)" # Check if there are staged changes
git push if git diff --cached --quiet; then
log "Pushed changes to Gitea."
else
log "No changes to sync." log "No changes to sync."
exit 0
fi fi
# Build a meaningful commit message from what actually changed
CHANGED=$(git diff --cached --name-only | tr '\n' ', ' | sed 's/,$//')
git commit -m "config: update ${CHANGED}"
git push
log "Pushed: ${CHANGED}"

View File

@@ -1,5 +1,5 @@
{ {
"updated_at": "2026-03-26T06:59:37.300889", "updated_at": "2026-03-26T08:00:22.606401",
"platforms": { "platforms": {
"discord": [ "discord": [
{ {