mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Before this change, if a package manager was not installed, safe-chain still sets the function and when invoked, the wrapper will invoke safe-chain, which will exit with error code 127 when it fails to invoke the wrapped command. As an example (with a shell prompt that shows $? when non-zero): ``` $ type -f pip bash: type: pip: not found 1$ pip 127$ ``` With this patch, the wrapper first checks for the existence of the wrapped command (ignoring functions), and if no such command exists, it instructs the shell to invoke it anyway. This results in the shell failing to find the command, and reporting an error as if the wrapper function wasn't there: ``` $ source init-posix.sh $ type -f pip bash: type: pip: not found 1$ pip Command 'pip' not found, but can be installed with: sudo apt install python3-pip 127$ ``` |
||
|---|---|---|
| .. | ||
| bin | ||
| src | ||
| .npmignore | ||
| package.json | ||
| tsconfig.json | ||