Sync 2026-04-14 06:33

This commit is contained in:
2026-04-14 06:33:02 +08:00
parent 1eba2bca95
commit df6ec8d6e1

29
sync.sh
View File

@@ -1,25 +1,12 @@
#!/bin/bash #!/bin/bash
# Hermes Sync Script
set -e set -e
SYNC_DIR="/root/hermes-sync-tmp" cd ~/.hermes-sync
BRANCH="$(hostname)" cp ~/.hermes/memories/MEMORY.md memories/MEMORY.md 2>/dev/null || true
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 add -A
if ! git diff --cached --quiet; then
git commit -m "Sync $(date '+%Y-%m-%d %H:%M')" || true git commit -m "Sync $(date '+%Y-%m-%d %H:%M')" || true
git push origin main || true git push origin main --force 2>&1
;; echo "Pushed at $(date)"
pull) else
git fetch origin echo "No changes to push"
git checkout HEAD -- memories/ skills/ 2>/dev/null || true fi
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