mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Handle comments from the PR
This commit is contained in:
parent
6c269a1bb5
commit
36c195f5a9
14 changed files with 166 additions and 181 deletions
|
|
@ -13,19 +13,22 @@ function isInstalled() {
|
|||
return doesExecutableExistOnSystem(executableName);
|
||||
}
|
||||
|
||||
function teardown() {
|
||||
function teardown(tools) {
|
||||
const startupFile = getStartupFile();
|
||||
|
||||
// Removes all aliases starting with "alias npm=", "alias npx=", or "alias yarn="
|
||||
// This will remove the safe-chain aliases for npm, npx, and yarn commands.
|
||||
removeLinesMatchingPattern(startupFile, /^alias\s+(npm|npx|yarn)\s+/);
|
||||
for (const { tool } of tools) {
|
||||
// Remove any existing alias for the tool
|
||||
removeLinesMatchingPattern(
|
||||
startupFile,
|
||||
new RegExp(`^alias\\s+${tool}\\s+`)
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function setup(tools) {
|
||||
const startupFile = getStartupFile();
|
||||
teardown();
|
||||
|
||||
for (const { tool, aikidoCommand } of tools) {
|
||||
addLineToFile(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue