launcher: export skill-dir env before the IMPECCABLE_BIN exec (sync engine fix)

Prepared with AI assistance (Claude Code).
This commit is contained in:
Paul Bakaus
2026-09-01 11:24:15 -07:00
parent 47f1871385
commit 4a04f6afea
+9 -5
View File
@@ -25,19 +25,23 @@ probe_ok() {
}
probing=${IMPECCABLE_LAUNCHER_PROBE:-}
if [ -n "${IMPECCABLE_BIN:-}" ] && [ -x "${IMPECCABLE_BIN}" ]; then
exec "${IMPECCABLE_BIN}" "$@"
fi
dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
# What the binary needs to know about its home: the skill directory (for
# reference/*.md and command-metadata.json) and how to name itself in the
# commands it prints.
# commands it prints. Exported BEFORE any exec below, including the
# IMPECCABLE_BIN override: an engine binary reached with no IMPECCABLE_SKILL_DIR
# cannot find reference/*.md (so native platform refs never inline) or read its
# own version (so UPDATE_AVAILABLE never fires). Setting it here covers every
# candidate the launcher can exec.
: "${IMPECCABLE_SKILL_DIR:=$(CDPATH= cd -- "$dir/.." && pwd)}"
: "${IMPECCABLE_SELF:=$0}"
export IMPECCABLE_SKILL_DIR IMPECCABLE_SELF
if [ -n "${IMPECCABLE_BIN:-}" ] && [ -x "${IMPECCABLE_BIN}" ]; then
exec "${IMPECCABLE_BIN}" "$@"
fi
case "$(uname -s 2>/dev/null || echo unknown)" in
Darwin) os=darwin ;;
Linux) os=linux ;;