[Fix] `install -s`: `zsh`: ensure `shwordsplit` opt is set

Fixes #1719.
Jordan Harband 2018-04-29 15:35:38 -07:00
parent 04c27e23fe
commit 3fc7b737f5
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
1 changed files with 13 additions and 0 deletions

13
nvm.sh
View File

@ -2047,6 +2047,13 @@ nvm_install_source() {
local TMPDIR local TMPDIR
local VERSION_PATH local VERSION_PATH
local ZSH_HAS_SHWORDSPLIT_UNSET
ZSH_HAS_SHWORDSPLIT_UNSET=1
if nvm_has "setopt"; then
ZSH_HAS_SHWORDSPLIT_UNSET="$(set +e ; setopt | nvm_grep -q shwordsplit ; nvm_echo $?)"
setopt shwordsplit
fi
TARBALL="$(nvm_download_artifact "${FLAVOR}" source "${TYPE}" "${VERSION}" | command tail -1)" && \ TARBALL="$(nvm_download_artifact "${FLAVOR}" source "${TYPE}" "${VERSION}" | command tail -1)" && \
[ -f "${TARBALL}" ] && \ [ -f "${TARBALL}" ] && \
TMPDIR="$(dirname "${TARBALL}")/files" && \ TMPDIR="$(dirname "${TARBALL}")/files" && \
@ -2062,10 +2069,16 @@ nvm_install_source() {
command rm -f "${VERSION_PATH}" 2>/dev/null && \ command rm -f "${VERSION_PATH}" 2>/dev/null && \
$make -j "${NVM_MAKE_JOBS}" ${MAKE_CXX-} install $make -j "${NVM_MAKE_JOBS}" ${MAKE_CXX-} install
); then ); then
if [ "$ZSH_HAS_SHWORDSPLIT_UNSET" -eq 1 ] && nvm_has "unsetopt"; then
unsetopt shwordsplit
fi
nvm_err "nvm: install ${VERSION} failed!" nvm_err "nvm: install ${VERSION} failed!"
command rm -rf "${TMPDIR-}" command rm -rf "${TMPDIR-}"
return 1 return 1
fi fi
if [ "$ZSH_HAS_SHWORDSPLIT_UNSET" -eq 1 ] && nvm_has "unsetopt"; then
unsetopt shwordsplit
fi
} }
nvm_use_if_needed() { nvm_use_if_needed() {