feat: add SPINE_ORG env var to override org file path

Add SPINE_ORG environment variable support to scripts/run. When set,
the value is passed as spine-org-file via --eval before loading spine.el.

Usage:
  SPINE_ORG=~/my-books.org ./scripts/run
  SPINE_ORG=/work/personal-local/spine/sample-books.org ./scripts/run localhost:9090

When unset, defaults to ~/spine/books.org (existing behavior).
This commit is contained in:
2026-06-23 22:19:51 -04:00
parent bbd9a455cd
commit 7f3769fcd8
2 changed files with 54 additions and 6 deletions
+5 -6
View File
@@ -15,14 +15,13 @@ if [ $# -ge 1 ] && [ -n "$1" ]; then
else
PORT="$ARG"
fi
fi
# Stop any existing spine daemon
emacsclient --socket-name=spine --eval '(kill-emacs)' 2>/dev/null || true
# Build emacs args
EMACS_ARGS=(emacs --quick --daemon=spine)
# If SPINE_ORG env var is set, override the org file path
if [ -n "${SPINE_ORG:-}" ]; then
EMACS_ARGS+=(--eval "(setq spine-org-file \"$SPINE_ORG\")")
fi
if [ -n "$HOST" ]; then
EMACS_ARGS+=(--eval "(setq spine-host \"$HOST\")")
fi