Use powershell functions to wrap npm, npx, yarn, pnpm and pnpx

This commit is contained in:
Sander Declerck 2025-07-23 11:16:38 +02:00
parent eba1e9cc8e
commit 577b09bd39
No known key found for this signature in database
6 changed files with 217 additions and 117 deletions

View file

@ -24,18 +24,22 @@ function teardown(tools) {
);
}
// Remove the line that sources the safe-chain PowerShell initialization script
removeLinesMatchingPattern(
startupFile,
/^\.\s+["']?\$HOME[/\\].safe-chain[/\\]scripts[/\\]init-pwsh\.ps1["']?/
);
return true;
}
function setup(tools) {
function setup() {
const startupFile = getStartupFile();
for (const { tool, aikidoCommand } of tools) {
addLineToFile(
startupFile,
`Set-Alias ${tool} ${aikidoCommand} # Safe-chain alias for ${tool}`
);
}
addLineToFile(
startupFile,
`. "$HOME\\.safe-chain\\scripts\\init-pwsh.ps1" # Safe-chain PowerShell initialization script`
);
return true;
}