mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-21 15:43:24 +01:00
fix(capy-install): the launch file appends the checkout's bin/ to PATH (GSTA-167)
A /ship child that sourced only the launch file got 'gstack-ship-budget: command not found' (exit 127). The file now appends <checkout>/bin once, after everything already on PATH, so it shadows nothing. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
9fa5e97c96
commit
4b623a490d
3 files changed
+18
-9
No files matched your search
@@ -656,13 +656,16 @@ WARN behind — installed $INSTALLED is ${GSTACK_CAPY_BEHIND:-?} commits behind
|
||||
[ -n "$NOTES" ] && TRAILER="$TRAILER ($NOTES)" ;;
|
||||
esac
|
||||
# The launch file: the same assignments as a sourceable script, mode 0600,
|
||||
# beside the verdict. `. <file>` applies them without ever printing them; the
|
||||
# beside the verdict. It also appends the checkout's bin directory to PATH
|
||||
# (after everything already there, so it shadows nothing): a skill's bare
|
||||
# `gstack-ship-budget` resolves in a shell that sourced only this file. `. <file>` applies them without ever printing them; the
|
||||
# line carries no secret, but a caller that re-typed it as `export $(...)`
|
||||
# ran a bare `export` when the substitution came back empty and dumped the
|
||||
# whole environment, API keys included, into its tool output (GSTA-96). The
|
||||
# file is part of the ok verdict: a passing run that cannot write it fails,
|
||||
# so no caller is left with only the line and the re-typing path.
|
||||
LAUNCH_FILE="${VERDICT%.json}.env"
|
||||
BIN_DIR=$(cd "$ROOT/bin" 2>/dev/null && pwd -P)
|
||||
write_launch_file() {
|
||||
local tmp
|
||||
mkdir -p "$(dirname "$LAUNCH_FILE")" || return 1
|
||||
@@ -672,6 +675,7 @@ write_launch_file() {
|
||||
echo "# Apply it with: . <this file>"
|
||||
echo "# Never print it or the environment: no \`export \$(...)\`, \`env\`, \`printenv\` or bare \`set\` in a tool fence."
|
||||
[ -n "$LAUNCH_DIR" ] && echo "case \":\$PATH:\" in *:$(shq "$LAUNCH_DIR"):*) ;; *) PATH=$(shq "$LAUNCH_DIR"):\"\$PATH\" ;; esac; export PATH"
|
||||
[ -n "$BIN_DIR" ] && echo "case \":\$PATH:\" in *:$(shq "$BIN_DIR"):*) ;; *) PATH=\"\${PATH:+\$PATH:}\"$(shq "$BIN_DIR") ;; esac; export PATH"
|
||||
echo "export GSTACK_SESSION_KIND=unattended"
|
||||
echo "export GSTACK_STATE_ROOT=$(shq "$GSTACK_STATE_ROOT")"
|
||||
echo "export GSTACK_EPHEMERAL=$(shq "${GSTACK_EPHEMERAL:-1}")"
|
||||
|
||||
Reference in new issue
Block a user