mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Some more cleanup
This commit is contained in:
parent
d064d46668
commit
031c9683b1
23 changed files with 55 additions and 864 deletions
|
|
@ -32,17 +32,12 @@ function teardown(tools) {
|
|||
);
|
||||
}
|
||||
|
||||
// Remove the line that sources the safe-chain PowerShell initialization script (any path, requires safe-chain comment)
|
||||
// Removes the line that sources the safe-chain PowerShell initialization script.
|
||||
removeLinesMatchingPattern(
|
||||
startupFile,
|
||||
/^\.\s+["']?.*init-pwsh\.ps1["']?.*#\s*Safe-chain/,
|
||||
);
|
||||
|
||||
removeLinesMatchingPattern(
|
||||
startupFile,
|
||||
/^\$env:SAFE_CHAIN_DIR\s*=.*#\s*Safe-chain/,
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -78,19 +73,20 @@ function getStartupFile() {
|
|||
}
|
||||
}
|
||||
|
||||
/** @param {string} preamble */
|
||||
function buildManualInstructions(preamble) {
|
||||
const instructions = [preamble, ` . "${path.join(getScriptsDir(), "init-pwsh.ps1")}"`];
|
||||
instructions.push(`Then restart your terminal or run: . $PROFILE`);
|
||||
return instructions;
|
||||
}
|
||||
|
||||
function getManualTeardownInstructions() {
|
||||
return buildManualInstructions(`Remove the following line from your PowerShell profile (run "echo $PROFILE" to find its location):`);
|
||||
return [
|
||||
`Remove the following line from your PowerShell profile (run "echo $PROFILE" to find its location):`,
|
||||
` . "${path.join(getScriptsDir(), "init-pwsh.ps1")}"`,
|
||||
`Then restart your terminal or run: . $PROFILE`,
|
||||
];
|
||||
}
|
||||
|
||||
function getManualSetupInstructions() {
|
||||
return buildManualInstructions(`Add the following line to your PowerShell profile (run "echo $PROFILE" to find its location):`);
|
||||
return [
|
||||
`Add the following line to your PowerShell profile (run "echo $PROFILE" to find its location):`,
|
||||
` . "${path.join(getScriptsDir(), "init-pwsh.ps1")}"`,
|
||||
`Then restart your terminal or run: . $PROFILE`,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue