Files
hermes-sync/sync.sh

26 lines
672 B
Bash
Executable File

#!/bin/bash
# Hermes Sync Script
set -e
SYNC_DIR="/root/hermes-sync-tmp"
BRANCH="$(hostname)"
cd "$SYNC_DIR"
case "$1" in
push)
cp /root/.hermes/memories/MEMORY.md memories/ 2>/dev/null || true
cp -r /root/.hermes/skills/github skills/github 2>/dev/null || true
git add -A
git commit -m "Sync $(date '+%Y-%m-%d %H:%M')" || true
git push origin main || true
;;
pull)
git fetch origin
git checkout HEAD -- memories/ skills/ 2>/dev/null || true
cp memories/MEMORY.md /root/.hermes/memories/ 2>/dev/null || true
cp -r skills/github /root/.hermes/skills/ 2>/dev/null || true
;;
*)
echo "Usage: $0 {push|pull}"
;;
esac