[Robustness] add `command` to `xargs`/`rm` in `nvm_get_default_packages`
Fixes #2281.
parent
1bf567bd0b
commit
16b75b7333
4
nvm.sh
4
nvm.sh
|
@ -3661,7 +3661,7 @@ nvm_get_default_packages() {
|
||||||
# ensure a trailing newline
|
# ensure a trailing newline
|
||||||
WORK=$(mktemp -d) || exit $?
|
WORK=$(mktemp -d) || exit $?
|
||||||
# shellcheck disable=SC2064
|
# shellcheck disable=SC2064
|
||||||
trap "rm -rf '$WORK'" EXIT
|
trap "command rm -rf '$WORK'" EXIT
|
||||||
# shellcheck disable=SC1003
|
# shellcheck disable=SC1003
|
||||||
sed -e '$a\' "${NVM_DEFAULT_PACKAGE_FILE}" > "${WORK}/default-packages"
|
sed -e '$a\' "${NVM_DEFAULT_PACKAGE_FILE}" > "${WORK}/default-packages"
|
||||||
while IFS=' ' read -r line; do
|
while IFS=' ' read -r line; do
|
||||||
|
@ -3681,7 +3681,7 @@ nvm_get_default_packages() {
|
||||||
|
|
||||||
DEFAULT_PACKAGES="${DEFAULT_PACKAGES}${line} "
|
DEFAULT_PACKAGES="${DEFAULT_PACKAGES}${line} "
|
||||||
done < "${WORK}/default-packages"
|
done < "${WORK}/default-packages"
|
||||||
echo "${DEFAULT_PACKAGES}" | xargs
|
echo "${DEFAULT_PACKAGES}" | command xargs
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue