From 2a186e47621e86397e94134295c44ea1aa0298e3 Mon Sep 17 00:00:00 2001 From: Vuong Hoang Date: Wed, 9 Sep 2026 09:21:34 -0700 Subject: [PATCH] fix(booth): CLI resolves its source through the ~/.local/bin symlink (readlink -f), so ask/asks/answer/unlink work from any cwd --- services/booth/scripts/booth | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/booth/scripts/booth b/services/booth/scripts/booth index 2054634..8bb97ed 100755 --- a/services/booth/scripts/booth +++ b/services/booth/scripts/booth @@ -184,7 +184,7 @@ case "$cmd" in esac # `|| exit 1` so a failure is reported rather than swallowed; `set -e` inside # a command substitution elsewhere in this script has bitten us already. - BOOTH_SRC="$(cd "$(dirname -- "$0")/.." && pwd)" python3 -c ' + BOOTH_SRC="$(cd "$(dirname -- "$(readlink -f -- "$0")")/.." && pwd)" python3 -c ' import os, pathlib, sys sys.path.insert(0, os.environ["BOOTH_SRC"]) from booth.links import remove_link_entry # stdlib only — no venv needed @@ -205,7 +205,7 @@ print("removed: %s %s" % (removed["desc"], removed["url"])) [ "${#opts[@]}" -ge 2 ] || { echo "an ask needs at least 2 options" >&2; exit 1; } # Validated through the SAME normaliser the page uses, so a session cannot # post a question the renderer would refuse. stdlib only — no venv needed. - BOOTH_SRC="$(cd "$(dirname -- "$0")/.." && pwd)" ASK_NOTES="$notes" python3 -c ' + BOOTH_SRC="$(cd "$(dirname -- "$(readlink -f -- "$0")")/.." && pwd)" ASK_NOTES="$notes" python3 -c ' import os, pathlib, sys sys.path.insert(0, os.environ["BOOTH_SRC"]) from booth.asks import AskError, write_ask @@ -219,7 +219,7 @@ except AskError as exc: ;; asks) [ $# -ge 1 ] || usage - BOOTH_SRC="$(cd "$(dirname -- "$0")/.." && pwd)" python3 -c ' + BOOTH_SRC="$(cd "$(dirname -- "$(readlink -f -- "$0")")/.." && pwd)" python3 -c ' import os, pathlib, sys sys.path.insert(0, os.environ["BOOTH_SRC"]) from booth.asks import list_asks