Skip to content

Commit 6e7eca7

Browse files
committed
Merge remote-tracking branch 'nvm/master'
2 parents b1d0454 + 942e9ab commit 6e7eca7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

nvm.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ nvm_echo() {
2222
}
2323
}
2424

25+
nvm_cd() {
26+
# shellcheck disable=SC1001,SC2164
27+
\cd "$@"
28+
}
29+
2530
nvm_err() {
2631
>&2 nvm_echo "$@"
2732
}
@@ -115,7 +120,7 @@ if [ -z "${NVM_DIR-}" ]; then
115120
NVM_SCRIPT_SOURCE="${BASH_SOURCE[0]}"
116121
fi
117122
# shellcheck disable=SC1001
118-
NVM_DIR="$(cd ${NVM_CD_FLAGS} "$(dirname "${NVM_SCRIPT_SOURCE:-$0}")" > /dev/null && \pwd)"
123+
NVM_DIR="$(nvm_cd ${NVM_CD_FLAGS} "$(dirname "${NVM_SCRIPT_SOURCE:-$0}")" > /dev/null && \pwd)"
119124
export NVM_DIR
120125
fi
121126
unset NVM_SCRIPT_SOURCE 2> /dev/null
@@ -1845,7 +1850,7 @@ nvm_install_source() {
18451850
command mkdir -p "${TMPDIR}" && \
18461851
command tar -x${tar_compression_flag}f "${TARBALL}" -C "${TMPDIR}" --strip-components 1 && \
18471852
VERSION_PATH="$(nvm_version_path "${PREFIXED_VERSION}")" && \
1848-
cd "${TMPDIR}" && \
1853+
nvm_cd "${TMPDIR}" && \
18491854
./configure --prefix="${VERSION_PATH}" $ADDITIONAL_PARAMETERS && \
18501855
$make -j "${NVM_MAKE_JOBS}" ${MAKE_CXX-} && \
18511856
command rm -f "${VERSION_PATH}" 2>/dev/null && \
@@ -3022,7 +3027,7 @@ nvm() {
30223027
for LINK in $LINKS; do
30233028
set +f; unset IFS # restore variable expansion
30243029
if [ -n "$LINK" ]; then
3025-
(cd "$LINK" && npm link)
3030+
(nvm_cd "$LINK" && npm link)
30263031
fi
30273032
done
30283033
set +f; unset IFS # restore variable expansion in case $LINKS was empty

0 commit comments

Comments
 (0)