init-fish: split up if to prevent expanded args to break the condition

This commit is contained in:
Sander Declerck 2025-09-24 14:51:32 +02:00
parent 5006bc6194
commit 1514fb44c5
No known key found for this signature in database

View file

@ -47,12 +47,16 @@ function pnpx
end end
function npm function npm
if test (count $argv) -eq 1 -a \( "$argv[1]" = "-v" -o "$argv[1]" = "--version" \) # If args is just -v or --version and nothing else, just run the `npm -v` command
# If args is just -v or --version and nothing else, just run the npm version command
# This is because nvm uses this to check the version of npm # This is because nvm uses this to check the version of npm
set argc (count $argv)
if test $argc -eq 1
switch $argv[1]
case "-v" "--version"
command npm $argv command npm $argv
return return
end end
end
wrapSafeChainCommand "npm" "aikido-npm" $argv wrapSafeChainCommand "npm" "aikido-npm" $argv
end end