Skip to content
Myr

[Fix] Enhance nvm debug for different environments

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Peter Dave Hello · committed by Peter Dave Hello · parent 13f3cdc · Browse files · 1 file+24 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+24 added−2 removed

  • other:+24 added−2 removed

1 file+24 added−2 removed

modified:nvm.sh+24 added-2 removed
2444 unmodified lines
2445 else2446 nvm_err "wget: not found"2447 fi24482449 for tool in git grep awk sed cut basename rm mkdir xargs; do2449 local TEST_TOOLS ADD_TEST_TOOLS2450 TEST_TOOLS="git grep awk"2451 ADD_TEST_TOOLS="sed cut basename rm mkdir xargs"2452 if [ "darwin" != "$(nvm_get_os)" ] && [ "freebsd" != "$(nvm_get_os)" ]; then2453 TEST_TOOLS="${TEST_TOOLS} ${ADD_TEST_TOOLS}"2454 else2455 for tool in ${ADD_TEST_TOOLS} ; do2456 if nvm_has "${tool}"; then2457 nvm_err "${tool}: $(nvm_command_info "${tool}")"2458 else2459 nvm_err "${tool}: not found"2460 fi2461 done2462 fi2463 for tool in ${TEST_TOOLS} ; do2464 local NVM_TOOL_VERSION2465 if nvm_has "${tool}"; then2451 nvm_err "${tool}: $(nvm_command_info ${tool}), $(command ${tool} --version | command head -n 1)"2466 if command ls -l "$(nvm_command_info "${tool}" | command awk '{print $1}')" | command grep -q busybox; then2467 NVM_TOOL_VERSION="$(command "${tool}" --help 2>&1 | command head -n 1)"2468 else2469 NVM_TOOL_VERSION="$(command "${tool}" --version 2>&1 | command head -n 1)"2470 fi2471 nvm_err "${tool}: $(nvm_command_info "${tool}"), ${NVM_TOOL_VERSION}"2472 else2473 nvm_err "${tool}: not found"2474 fi2475 unset NVM_TOOL_VERSION2476 done2477 unset TEST_TOOLS ADD_TEST_TOOLS24782479 local NVM_DEBUG_OUTPUT2480 for NVM_DEBUG_COMMAND in 'nvm current' 'which node' 'which iojs' 'which npm' 'npm config get prefix' 'npm root -g'2481 do
1127 unmodified lines