Handle comments from the PR

This commit is contained in:
Sander Declerck 2025-07-18 14:23:51 +02:00
parent 6c269a1bb5
commit 36c195f5a9
No known key found for this signature in database
14 changed files with 166 additions and 181 deletions

View file

@ -13,19 +13,19 @@ 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)=/);
for (const { tool } of tools) {
// Remove any existing alias for the tool
removeLinesMatchingPattern(startupFile, new RegExp(`^alias\\s+${tool}=`));
}
return true;
}
function setup(tools) {
const startupFile = getStartupFile();
teardown();
for (const { tool, aikidoCommand } of tools) {
addLineToFile(