[Fix] `reinstall-packages`: handle global symlink locations properly
This is a regression caused by npm ls -g in npm 7 no longer returning absolute paths.
parent
fa63399991
commit
f03f69508e
5
nvm.sh
5
nvm.sh
|
@ -3978,7 +3978,10 @@ nvm() {
|
||||||
for LINK in ${LINKS}; do
|
for LINK in ${LINKS}; do
|
||||||
set +f; unset IFS # restore variable expansion
|
set +f; unset IFS # restore variable expansion
|
||||||
if [ -n "${LINK}" ]; then
|
if [ -n "${LINK}" ]; then
|
||||||
(nvm_cd "${LINK}" && npm link)
|
case "${LINK}" in
|
||||||
|
'/'*) (nvm_cd "${LINK}" && npm link) ;;
|
||||||
|
*) (nvm_cd "$(npm root -g)/../${LINK}" && npm link)
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue