Skip to content
Myr

[Fix] `zsh`: when `warncreateglobal` is set, this line warns for some reason. Use `env` to suppress it.

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

Fixes #1236.

authored by Jordan Harband · committed by Jordan Harband · parent acbdd9a · Browse files · 2 files+4 added−4 removed
This commit

State

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

Diff stats

2 files+4 added−4 removed

  • tests:+2 added−2 removed
  • other:+2 added−2 removed

2 files+4 added−4 removed

modified:test/fast/Unit tests/nvm_die_on_prefix+2 added-2 removed
34 unmodified lines
3536npm() {37 local args38 args="$@"39 if [ "_$args" = "_config get prefix" ]; then39 if [ "_$args" = "_config --loglevel=warn get prefix" ]; then40 echo "$(nvm_version_dir new)/good prefix"41 fi42}43OUTPUT="$(nvm_die_on_prefix 0 foo 2>&1)"
15 unmodified lines
5960npm() {61 local args62 args="$@"63 if [ "_$args" = "_config get prefix" ]; then63 if [ "_$args" = "_config --loglevel=warn get prefix" ]; then64 echo "./bad prefix"65 fi66}67OUTPUT="$(nvm_die_on_prefix 0 foo 2>&1)"
7 unmodified lines
modified:nvm.sh+2 added-2 removed
1943 unmodified lines
1944 return1945 fi19461947 local NVM_NPM_PREFIX1948 NVM_NPM_PREFIX="$(NPM_CONFIG_LOGLEVEL=warn npm config get prefix)"1948 NVM_NPM_PREFIX="$(npm config --loglevel=warn get prefix)"1949 if ! (nvm_tree_contains_path "$NVM_DIR" "$NVM_NPM_PREFIX" >/dev/null 2>&1); then1950 if [ "_$NVM_DELETE_PREFIX" = "_1" ]; then1951 NPM_CONFIG_LOGLEVEL=warn npm config delete prefix1951 npm config --loglevel=warn delete prefix1952 else1953 nvm deactivate >/dev/null 2>&11954 nvm_err "nvm is not compatible with the npm config \"prefix\" option: currently set to \"$NVM_NPM_PREFIX\""1955 if nvm_has 'npm'; then
1229 unmodified lines