unset PKG_EXECPATH before invoking safe-chain binary

This commit is contained in:
Reinier Criel 2026-05-13 14:33:58 -07:00
parent 0c8de1e606
commit d9b7aefd34
5 changed files with 78 additions and 5 deletions

View file

@ -109,8 +109,10 @@ function wrapSafeChainCommand() {
fi
if command -v safe-chain > /dev/null 2>&1; then
# If the aikido command is available, just run it with the provided arguments
safe-chain "$@"
# If the aikido command is available, just run it with the provided arguments.
# Unset PKG_EXECPATH so the yao-pkg bootstrap inside the safe-chain binary doesn't
# mistake argv[1] for a script path and try to resolve it against cwd.
(unset PKG_EXECPATH; safe-chain "$@")
else
# If the aikido command is not available, print a warning and run the original command
printSafeChainWarning "$original_cmd"