config: update bin/sync-up.sh,channel_directory.json
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/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.
|
||||
# Only commits when there are REAL changes (not empty syncs).
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
@@ -12,31 +12,29 @@ 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 ===
|
||||
# === Only commit if there are real diffs ===
|
||||
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
|
||||
git add -A
|
||||
|
||||
# Check if there are staged changes
|
||||
if git diff --cached --quiet; then
|
||||
log "No changes to sync."
|
||||
exit 0
|
||||
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}"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"updated_at": "2026-03-26T06:59:37.300889",
|
||||
"updated_at": "2026-03-26T08:00:22.606401",
|
||||
"platforms": {
|
||||
"discord": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user