bin: add sync script for lotus-land-story
Assisted-by: Claude Opus 5 via Claude Code
change zxwsotrxxxnlspzlyqmkpvnxwokulptx
commit b6bb21dd55bf94431b5d51afca8a8bfdb02ce796
author Alpha Chen <alpha@kejadlen.dev>
date
parent mmzoslyu
diff --git a/bin/sync b/bin/sync
new file mode 100755
index 0000000..1fc70f1
--- /dev/null
+++ b/bin/sync
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+if [[ "${TRACE-0}" == "1" ]]; then
+    set -o xtrace
+fi
+
+readonly HOST="${GISTS_HOST:-lotus-land-story}"
+readonly DEST="${GISTS_DEST:-/mnt/lotus-land-story/caddy/data/gists}"
+
+main() {
+    local root
+    root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
+
+    rsync \
+        --archive \
+        --compress \
+        --itemize-changes \
+        --include='*.html' \
+        --include='*.md' \
+        --exclude='*' \
+        "$@" \
+        "$root/" "$HOST:$DEST/"
+}
+
+main "$@"