Enhance nvm debug with more tools info

Peter Dave Hello 2017-09-21 22:09:02 +08:00
parent 334897ae39
commit d535c97d0f
1 changed files with 9 additions and 5 deletions

14
nvm.sh
View File

@ -2402,11 +2402,15 @@ nvm() {
else else
nvm_err "wget: not found" nvm_err "wget: not found"
fi fi
if nvm_has "git"; then
nvm_err "git: $(nvm_command_info git), $(command git --version)" for tool in git grep awk sed cut basename rm mkdir xargs; do
else if nvm_has "${tool}"; then
nvm_err "git: not found" nvm_err "${tool}: $(nvm_command_info ${tool}), $(command ${tool} --version | command head -n 1)"
fi else
nvm_err "${tool}: not found"
fi
done
local NVM_DEBUG_OUTPUT local NVM_DEBUG_OUTPUT
for NVM_DEBUG_COMMAND in 'nvm current' 'which node' 'which iojs' 'which npm' 'npm config get prefix' 'npm root -g' for NVM_DEBUG_COMMAND in 'nvm current' 'which node' 'which iojs' 'which npm' 'npm config get prefix' 'npm root -g'
do do