mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Use functions to wrap package managers and detect if the aikido commands are available
This commit is contained in:
parent
ccce2279c9
commit
ca5d3ecb2a
4 changed files with 118 additions and 45 deletions
|
|
@ -24,18 +24,22 @@ function teardown(tools) {
|
|||
);
|
||||
}
|
||||
|
||||
// Removes the line that sources the safe-chain fish initialization script (~/.safe-chain/scripts/init-fish.fish)
|
||||
removeLinesMatchingPattern(
|
||||
startupFile,
|
||||
/^source\s+~\/\.safe-chain\/scripts\/init-fish\.fish/
|
||||
);
|
||||
|
||||
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-fish.fish # Safe-chain Fish initialization script`
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue