mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Fix broken shell integration with nvm for Zsh and Bash
This commit is contained in:
parent
4424ba2e5b
commit
24d4862dfd
6 changed files with 63 additions and 53 deletions
|
|
@ -21,18 +21,22 @@ function teardown(tools) {
|
|||
removeLinesMatchingPattern(startupFile, new RegExp(`^alias\\s+${tool}=`));
|
||||
}
|
||||
|
||||
// Removes the line that sources the safe-chain bash initialization script (~/.aikido/scripts/init-posix.sh)
|
||||
removeLinesMatchingPattern(
|
||||
startupFile,
|
||||
/^source\s+~\/\.safe-chain\/scripts\/init-posix\.sh/
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function setup(tools) {
|
||||
function setup() {
|
||||
const startupFile = getStartupFile();
|
||||
|
||||
for (const { tool, aikidoCommand } of tools) {
|
||||
addLineToFile(
|
||||
startupFile,
|
||||
`alias ${tool}="${aikidoCommand}" # Safe-chain alias for ${tool}`
|
||||
);
|
||||
}
|
||||
addLineToFile(
|
||||
startupFile,
|
||||
`source ~/.safe-chain/scripts/init-posix.sh # Safe-chain bash initialization script`
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue