[shellcheck] double-quote vars in more places
parent
84aad508f7
commit
e7e28f436e
90
nvm.sh
90
nvm.sh
|
@ -33,7 +33,7 @@ nvm_get_latest() {
|
||||||
>&2 echo "http://latest.nvm.sh did not redirect to the latest release on Github"
|
>&2 echo "http://latest.nvm.sh did not redirect to the latest release on Github"
|
||||||
return 2
|
return 2
|
||||||
else
|
else
|
||||||
echo "$NVM_LATEST_URL" | command awk -F'/' '{print $NF}'
|
echo "$NVM_LATEST_URL" | command awk -F '/' '{print $NF}'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ if [ -z "$NVM_DIR" ]; then
|
||||||
if [ -n "$BASH_SOURCE" ]; then
|
if [ -n "$BASH_SOURCE" ]; then
|
||||||
NVM_SCRIPT_SOURCE="${BASH_SOURCE[0]}"
|
NVM_SCRIPT_SOURCE="${BASH_SOURCE[0]}"
|
||||||
fi
|
fi
|
||||||
NVM_DIR="$(cd $NVM_CD_FLAGS $(dirname "${NVM_SCRIPT_SOURCE:-$0}") > /dev/null && \pwd)"
|
NVM_DIR="$(cd $NVM_CD_FLAGS "$(dirname "${NVM_SCRIPT_SOURCE:-$0}")" > /dev/null && \pwd)"
|
||||||
export NVM_DIR
|
export NVM_DIR
|
||||||
fi
|
fi
|
||||||
unset NVM_SCRIPT_SOURCE 2> /dev/null
|
unset NVM_SCRIPT_SOURCE 2> /dev/null
|
||||||
|
@ -147,18 +147,18 @@ nvm_rc_version() {
|
||||||
|
|
||||||
nvm_version_greater() {
|
nvm_version_greater() {
|
||||||
local LHS
|
local LHS
|
||||||
LHS=$(nvm_normalize_version "$1")
|
LHS="$(nvm_normalize_version "$1")"
|
||||||
local RHS
|
local RHS
|
||||||
RHS=$(nvm_normalize_version "$2")
|
RHS="$(nvm_normalize_version "$2")"
|
||||||
[ $LHS -gt $RHS ];
|
[ "$LHS" -gt "$RHS" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
nvm_version_greater_than_or_equal_to() {
|
nvm_version_greater_than_or_equal_to() {
|
||||||
local LHS
|
local LHS
|
||||||
LHS=$(nvm_normalize_version "$1")
|
LHS="$(nvm_normalize_version "$1")"
|
||||||
local RHS
|
local RHS
|
||||||
RHS=$(nvm_normalize_version "$2")
|
RHS="$(nvm_normalize_version "$2")"
|
||||||
[ $LHS -ge $RHS ];
|
[ "$LHS" -ge "$RHS" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
nvm_version_dir() {
|
nvm_version_dir() {
|
||||||
|
@ -381,7 +381,7 @@ nvm_binary_available() {
|
||||||
# binaries started with node 0.8.6
|
# binaries started with node 0.8.6
|
||||||
local FIRST_VERSION_WITH_BINARY
|
local FIRST_VERSION_WITH_BINARY
|
||||||
FIRST_VERSION_WITH_BINARY="0.8.6"
|
FIRST_VERSION_WITH_BINARY="0.8.6"
|
||||||
nvm_version_greater_than_or_equal_to "$(nvm_strip_iojs_prefix $1)" "$FIRST_VERSION_WITH_BINARY"
|
nvm_version_greater_than_or_equal_to "$(nvm_strip_iojs_prefix "$1")" "$FIRST_VERSION_WITH_BINARY"
|
||||||
}
|
}
|
||||||
|
|
||||||
nvm_alias() {
|
nvm_alias() {
|
||||||
|
@ -556,7 +556,7 @@ nvm_ls() {
|
||||||
if nvm_resolve_local_alias "$PATTERN"; then
|
if nvm_resolve_local_alias "$PATTERN"; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
PATTERN=$(nvm_ensure_version_prefix $PATTERN)
|
PATTERN="$(nvm_ensure_version_prefix "$PATTERN")"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
if [ "_$PATTERN" = "_N/A" ]; then
|
if [ "_$PATTERN" = "_N/A" ]; then
|
||||||
|
@ -654,7 +654,7 @@ nvm_ls() {
|
||||||
)"
|
)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $ZHS_HAS_SHWORDSPLIT_UNSET -eq 1 ] && nvm_has "unsetopt"; then
|
if [ "$ZHS_HAS_SHWORDSPLIT_UNSET" -eq 1 ] && nvm_has "unsetopt"; then
|
||||||
unsetopt shwordsplit
|
unsetopt shwordsplit
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -717,7 +717,7 @@ nvm_ls_remote_iojs_org() {
|
||||||
PATTERN="$3"
|
PATTERN="$3"
|
||||||
local VERSIONS
|
local VERSIONS
|
||||||
if [ -n "$PATTERN" ]; then
|
if [ -n "$PATTERN" ]; then
|
||||||
PATTERN="$(nvm_ensure_version_prefix $(nvm_strip_iojs_prefix "$PATTERN"))"
|
PATTERN="$(nvm_ensure_version_prefix "$(nvm_strip_iojs_prefix "$PATTERN")")"
|
||||||
else
|
else
|
||||||
PATTERN=".*"
|
PATTERN=".*"
|
||||||
fi
|
fi
|
||||||
|
@ -774,7 +774,7 @@ nvm_print_versions() {
|
||||||
else
|
else
|
||||||
FORMAT='%15s'
|
FORMAT='%15s'
|
||||||
fi
|
fi
|
||||||
command printf "$FORMAT\n" $VERSION
|
command printf "$FORMAT\n" "$VERSION"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -821,7 +821,7 @@ nvm_print_implicit_alias() {
|
||||||
NVM_COMMAND="nvm_ls_remote_iojs"
|
NVM_COMMAND="nvm_ls_remote_iojs"
|
||||||
NVM_ADD_PREFIX_COMMAND="nvm_add_iojs_prefix"
|
NVM_ADD_PREFIX_COMMAND="nvm_add_iojs_prefix"
|
||||||
if [ "_$1" = "_local" ]; then
|
if [ "_$1" = "_local" ]; then
|
||||||
NVM_COMMAND="nvm_ls "$NVM_IMPLICIT""
|
NVM_COMMAND="nvm_ls $NVM_IMPLICIT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ZHS_HAS_SHWORDSPLIT_UNSET=1
|
ZHS_HAS_SHWORDSPLIT_UNSET=1
|
||||||
|
@ -835,10 +835,10 @@ nvm_print_implicit_alias() {
|
||||||
NVM_IOJS_VERSION="$($NVM_COMMAND)"
|
NVM_IOJS_VERSION="$($NVM_COMMAND)"
|
||||||
EXIT_CODE="$?"
|
EXIT_CODE="$?"
|
||||||
if [ "_$EXIT_CODE" = "_0" ]; then
|
if [ "_$EXIT_CODE" = "_0" ]; then
|
||||||
NVM_IOJS_VERSION="$(echo "$NVM_IOJS_VERSION" | sed "s/^"$NVM_IMPLICIT"-//" | command grep -e '^v' | command cut -c2- | command cut -d . -f 1,2 | uniq | command tail -1)"
|
NVM_IOJS_VERSION="$(echo "$NVM_IOJS_VERSION" | sed "s/^$NVM_IMPLICIT-//" | command grep -e '^v' | command cut -c2- | command cut -d . -f 1,2 | uniq | command tail -1)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $ZHS_HAS_SHWORDSPLIT_UNSET -eq 1 ] && nvm_has "unsetopt"; then
|
if [ "$ZHS_HAS_SHWORDSPLIT_UNSET" -eq 1 ] && nvm_has "unsetopt"; then
|
||||||
unsetopt shwordsplit
|
unsetopt shwordsplit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -867,7 +867,7 @@ nvm_print_implicit_alias() {
|
||||||
|
|
||||||
LAST_TWO=$($NVM_COMMAND | command grep -e '^v' | command cut -c2- | command cut -d . -f 1,2 | uniq)
|
LAST_TWO=$($NVM_COMMAND | command grep -e '^v' | command cut -c2- | command cut -d . -f 1,2 | uniq)
|
||||||
|
|
||||||
if [ $ZHS_HAS_SHWORDSPLIT_UNSET -eq 1 ] && nvm_has "unsetopt"; then
|
if [ "$ZHS_HAS_SHWORDSPLIT_UNSET" -eq 1 ] && nvm_has "unsetopt"; then
|
||||||
unsetopt shwordsplit
|
unsetopt shwordsplit
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
@ -889,21 +889,21 @@ nvm_print_implicit_alias() {
|
||||||
STABLE="$MINOR"
|
STABLE="$MINOR"
|
||||||
else
|
else
|
||||||
MOD=$(expr "$NORMALIZED_VERSION" \/ 1000000 \% 2)
|
MOD=$(expr "$NORMALIZED_VERSION" \/ 1000000 \% 2)
|
||||||
if [ $MOD -eq 0 ]; then
|
if [ "$MOD" -eq 0 ]; then
|
||||||
STABLE="$MINOR"
|
STABLE="$MINOR"
|
||||||
elif [ $MOD -eq 1 ]; then
|
elif [ "$MOD" -eq 1 ]; then
|
||||||
UNSTABLE="$MINOR"
|
UNSTABLE="$MINOR"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ $ZHS_HAS_SHWORDSPLIT_UNSET -eq 1 ] && nvm_has "unsetopt"; then
|
if [ "$ZHS_HAS_SHWORDSPLIT_UNSET" -eq 1 ] && nvm_has "unsetopt"; then
|
||||||
unsetopt shwordsplit
|
unsetopt shwordsplit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "_$2" = "_stable" ]; then
|
if [ "_$2" = '_stable' ]; then
|
||||||
echo $STABLE
|
echo "${STABLE}"
|
||||||
elif [ "_$2" = "_unstable" ]; then
|
elif [ "_$2" = '_unstable' ]; then
|
||||||
echo $UNSTABLE
|
echo "${UNSTABLE}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1013,7 +1013,7 @@ nvm_install_merged_node_binary() {
|
||||||
if [ -n "$NVM_OS" ]; then
|
if [ -n "$NVM_OS" ]; then
|
||||||
t="$VERSION-$NVM_OS-$(nvm_get_arch)"
|
t="$VERSION-$NVM_OS-$(nvm_get_arch)"
|
||||||
url="$MIRROR/$VERSION/$NODE_PREFIX-${t}.tar.${compression}"
|
url="$MIRROR/$VERSION/$NODE_PREFIX-${t}.tar.${compression}"
|
||||||
sum="$(nvm_download -L -s $MIRROR/$VERSION/SHASUMS256.txt -o - | command grep $NODE_PREFIX-${t}.tar.${compression} | command awk '{print $1}')"
|
sum="$(nvm_download -L -s "$MIRROR/$VERSION/SHASUMS256.txt" -o - | command grep "${NODE_PREFIX}-${t}.tar.${compression}" | command awk '{print $1}')"
|
||||||
local tmpdir
|
local tmpdir
|
||||||
tmpdir="$NVM_DIR/bin/node-${t}"
|
tmpdir="$NVM_DIR/bin/node-${t}"
|
||||||
local tmptarball
|
local tmptarball
|
||||||
|
@ -1021,7 +1021,7 @@ nvm_install_merged_node_binary() {
|
||||||
local NVM_INSTALL_ERRORED
|
local NVM_INSTALL_ERRORED
|
||||||
command mkdir -p "$tmpdir" && \
|
command mkdir -p "$tmpdir" && \
|
||||||
echo "Downloading $url..." && \
|
echo "Downloading $url..." && \
|
||||||
nvm_download -L -C - --progress-bar $url -o "$tmptarball" || \
|
nvm_download -L -C - --progress-bar "$url" -o "$tmptarball" || \
|
||||||
NVM_INSTALL_ERRORED=true
|
NVM_INSTALL_ERRORED=true
|
||||||
if grep '404 Not Found' "$tmptarball" >/dev/null; then
|
if grep '404 Not Found' "$tmptarball" >/dev/null; then
|
||||||
NVM_INSTALL_ERRORED=true
|
NVM_INSTALL_ERRORED=true
|
||||||
|
@ -1030,7 +1030,7 @@ nvm_install_merged_node_binary() {
|
||||||
if (
|
if (
|
||||||
[ "$NVM_INSTALL_ERRORED" != true ] && \
|
[ "$NVM_INSTALL_ERRORED" != true ] && \
|
||||||
echo "WARNING: checksums are currently disabled for node.js v4.0 and later" >&2 && \
|
echo "WARNING: checksums are currently disabled for node.js v4.0 and later" >&2 && \
|
||||||
# nvm_checksum "$tmptarball" $sum && \
|
# nvm_checksum "$tmptarball" "$sum" && \
|
||||||
command tar -x${tar_compression_flag}f "$tmptarball" -C "$tmpdir" --strip-components 1 && \
|
command tar -x${tar_compression_flag}f "$tmptarball" -C "$tmpdir" --strip-components 1 && \
|
||||||
command rm -f "$tmptarball" && \
|
command rm -f "$tmptarball" && \
|
||||||
command mkdir -p "$VERSION_PATH" && \
|
command mkdir -p "$VERSION_PATH" && \
|
||||||
|
@ -1088,7 +1088,7 @@ nvm_install_iojs_binary() {
|
||||||
if nvm_binary_available "$VERSION"; then
|
if nvm_binary_available "$VERSION"; then
|
||||||
t="$VERSION-$NVM_OS-$(nvm_get_arch)"
|
t="$VERSION-$NVM_OS-$(nvm_get_arch)"
|
||||||
url="$MIRROR/$VERSION/$(nvm_iojs_prefix)-${t}.tar.${compression}"
|
url="$MIRROR/$VERSION/$(nvm_iojs_prefix)-${t}.tar.${compression}"
|
||||||
sum="$(nvm_download -L -s $MIRROR/$VERSION/SHASUMS256.txt -o - | command grep $(nvm_iojs_prefix)-${t}.tar.${compression} | command awk '{print $1}')"
|
sum="$(nvm_download -L -s "$MIRROR/$VERSION/SHASUMS256.txt" -o - | command grep "$(nvm_iojs_prefix)-${t}.tar.${compression}" | command awk '{print $1}')"
|
||||||
local tmpdir
|
local tmpdir
|
||||||
tmpdir="$NVM_DIR/bin/iojs-${t}"
|
tmpdir="$NVM_DIR/bin/iojs-${t}"
|
||||||
local tmptarball
|
local tmptarball
|
||||||
|
@ -1096,7 +1096,7 @@ nvm_install_iojs_binary() {
|
||||||
local NVM_INSTALL_ERRORED
|
local NVM_INSTALL_ERRORED
|
||||||
command mkdir -p "$tmpdir" && \
|
command mkdir -p "$tmpdir" && \
|
||||||
echo "Downloading $url..." && \
|
echo "Downloading $url..." && \
|
||||||
nvm_download -L -C - --progress-bar $url -o "$tmptarball" || \
|
nvm_download -L -C - --progress-bar "$url" -o "$tmptarball" || \
|
||||||
NVM_INSTALL_ERRORED=true
|
NVM_INSTALL_ERRORED=true
|
||||||
if grep '404 Not Found' "$tmptarball" >/dev/null; then
|
if grep '404 Not Found' "$tmptarball" >/dev/null; then
|
||||||
NVM_INSTALL_ERRORED=true
|
NVM_INSTALL_ERRORED=true
|
||||||
|
@ -1105,7 +1105,7 @@ nvm_install_iojs_binary() {
|
||||||
if (
|
if (
|
||||||
[ "$NVM_INSTALL_ERRORED" != true ] && \
|
[ "$NVM_INSTALL_ERRORED" != true ] && \
|
||||||
echo "WARNING: checksums are currently disabled for io.js" >&2 && \
|
echo "WARNING: checksums are currently disabled for io.js" >&2 && \
|
||||||
# nvm_checksum "$tmptarball" $sum && \
|
# nvm_checksum "$tmptarball" "$sum" && \
|
||||||
command tar -x${tar_compression_flag}f "$tmptarball" -C "$tmpdir" --strip-components 1 && \
|
command tar -x${tar_compression_flag}f "$tmptarball" -C "$tmpdir" --strip-components 1 && \
|
||||||
command rm -f "$tmptarball" && \
|
command rm -f "$tmptarball" && \
|
||||||
command mkdir -p "$VERSION_PATH" && \
|
command mkdir -p "$VERSION_PATH" && \
|
||||||
|
@ -1145,19 +1145,19 @@ nvm_install_node_binary() {
|
||||||
if nvm_binary_available "$VERSION"; then
|
if nvm_binary_available "$VERSION"; then
|
||||||
local NVM_ARCH
|
local NVM_ARCH
|
||||||
NVM_ARCH="$(nvm_get_arch)"
|
NVM_ARCH="$(nvm_get_arch)"
|
||||||
if [ $NVM_ARCH = "armv6l" ] || [ $NVM_ARCH = "armv7l" ]; then
|
if [ "_$NVM_ARCH" = '_armv6l' ] || [ "_$NVM_ARCH" = 'armv7l' ]; then
|
||||||
NVM_ARCH="arm-pi"
|
NVM_ARCH="arm-pi"
|
||||||
fi
|
fi
|
||||||
t="$VERSION-$NVM_OS-$NVM_ARCH"
|
t="$VERSION-$NVM_OS-$NVM_ARCH"
|
||||||
url="$NVM_NODEJS_ORG_MIRROR/$VERSION/node-${t}.tar.gz"
|
url="$NVM_NODEJS_ORG_MIRROR/$VERSION/node-${t}.tar.gz"
|
||||||
sum=`nvm_download -L -s $NVM_NODEJS_ORG_MIRROR/$VERSION/SHASUMS.txt -o - | command grep node-${t}.tar.gz | command awk '{print $1}'`
|
sum=`nvm_download -L -s "$NVM_NODEJS_ORG_MIRROR/$VERSION/SHASUMS.txt" -o - | command grep "node-${t}.tar.gz" | command awk '{print $1}'`
|
||||||
local tmpdir
|
local tmpdir
|
||||||
tmpdir="$NVM_DIR/bin/node-${t}"
|
tmpdir="$NVM_DIR/bin/node-${t}"
|
||||||
local tmptarball
|
local tmptarball
|
||||||
tmptarball="$tmpdir/node-${t}.tar.gz"
|
tmptarball="$tmpdir/node-${t}.tar.gz"
|
||||||
local NVM_INSTALL_ERRORED
|
local NVM_INSTALL_ERRORED
|
||||||
command mkdir -p "$tmpdir" && \
|
command mkdir -p "$tmpdir" && \
|
||||||
nvm_download -L -C - --progress-bar $url -o "$tmptarball" || \
|
nvm_download -L -C - --progress-bar "$url" -o "$tmptarball" || \
|
||||||
NVM_INSTALL_ERRORED=true
|
NVM_INSTALL_ERRORED=true
|
||||||
if grep '404 Not Found' "$tmptarball" >/dev/null; then
|
if grep '404 Not Found' "$tmptarball" >/dev/null; then
|
||||||
NVM_INSTALL_ERRORED=true
|
NVM_INSTALL_ERRORED=true
|
||||||
|
@ -1165,7 +1165,7 @@ nvm_install_node_binary() {
|
||||||
fi
|
fi
|
||||||
if (
|
if (
|
||||||
[ "$NVM_INSTALL_ERRORED" != true ] && \
|
[ "$NVM_INSTALL_ERRORED" != true ] && \
|
||||||
nvm_checksum "$tmptarball" $sum && \
|
nvm_checksum "$tmptarball" "$sum" && \
|
||||||
command tar -xzf "$tmptarball" -C "$tmpdir" --strip-components 1 && \
|
command tar -xzf "$tmptarball" -C "$tmpdir" --strip-components 1 && \
|
||||||
command rm -f "$tmptarball" && \
|
command rm -f "$tmptarball" && \
|
||||||
command mkdir -p "$VERSION_PATH" && \
|
command mkdir -p "$VERSION_PATH" && \
|
||||||
|
@ -1190,7 +1190,7 @@ nvm_install_node_source() {
|
||||||
|
|
||||||
local NVM_ARCH
|
local NVM_ARCH
|
||||||
NVM_ARCH="$(nvm_get_arch)"
|
NVM_ARCH="$(nvm_get_arch)"
|
||||||
if [ $NVM_ARCH = "armv6l" ] || [ $NVM_ARCH = "armv7l" ]; then
|
if [ "_$NVM_ARCH" = '_armv6l' ] || [ "_$NVM_ARCH" = '_armv7l' ]; then
|
||||||
ADDITIONAL_PARAMETERS="--without-snapshot $ADDITIONAL_PARAMETERS"
|
ADDITIONAL_PARAMETERS="--without-snapshot $ADDITIONAL_PARAMETERS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1220,7 +1220,7 @@ nvm_install_node_source() {
|
||||||
|
|
||||||
if [ "`nvm_download -L -s -I "$NVM_NODEJS_ORG_MIRROR/$VERSION/node-$VERSION.tar.gz" -o - 2>&1 | command grep '200 OK'`" != '' ]; then
|
if [ "`nvm_download -L -s -I "$NVM_NODEJS_ORG_MIRROR/$VERSION/node-$VERSION.tar.gz" -o - 2>&1 | command grep '200 OK'`" != '' ]; then
|
||||||
tarball="$NVM_NODEJS_ORG_MIRROR/$VERSION/node-$VERSION.tar.gz"
|
tarball="$NVM_NODEJS_ORG_MIRROR/$VERSION/node-$VERSION.tar.gz"
|
||||||
sum=`nvm_download -L -s $NVM_NODEJS_ORG_MIRROR/$VERSION/SHASUMS.txt -o - | command grep "node-$VERSION.tar.gz" | command awk '{print $1}'`
|
sum=`nvm_download -L -s "$NVM_NODEJS_ORG_MIRROR/$VERSION/SHASUMS.txt" -o - | command grep "node-${VERSION}.tar.gz" | command awk '{print $1}'`
|
||||||
elif [ "`nvm_download -L -s -I "$NVM_NODEJS_ORG_MIRROR/node-$VERSION.tar.gz" -o - | command grep '200 OK'`" != '' ]; then
|
elif [ "`nvm_download -L -s -I "$NVM_NODEJS_ORG_MIRROR/node-$VERSION.tar.gz" -o - | command grep '200 OK'`" != '' ]; then
|
||||||
tarball="$NVM_NODEJS_ORG_MIRROR/node-$VERSION.tar.gz"
|
tarball="$NVM_NODEJS_ORG_MIRROR/node-$VERSION.tar.gz"
|
||||||
fi
|
fi
|
||||||
|
@ -1229,8 +1229,8 @@ nvm_install_node_source() {
|
||||||
[ -n "$tarball" ] && \
|
[ -n "$tarball" ] && \
|
||||||
command mkdir -p "$tmpdir" && \
|
command mkdir -p "$tmpdir" && \
|
||||||
echo "Downloading $tarball..." && \
|
echo "Downloading $tarball..." && \
|
||||||
nvm_download -L --progress-bar $tarball -o "$tmptarball" && \
|
nvm_download -L --progress-bar "$tarball" -o "$tmptarball" && \
|
||||||
nvm_checksum "$tmptarball" $sum && \
|
nvm_checksum "$tmptarball" "$sum" && \
|
||||||
command tar -xzf "$tmptarball" -C "$tmpdir" && \
|
command tar -xzf "$tmptarball" -C "$tmpdir" && \
|
||||||
cd "$tmpdir/node-$VERSION" && \
|
cd "$tmpdir/node-$VERSION" && \
|
||||||
./configure --prefix="$VERSION_PATH" $ADDITIONAL_PARAMETERS && \
|
./configure --prefix="$VERSION_PATH" $ADDITIONAL_PARAMETERS && \
|
||||||
|
@ -1378,7 +1378,7 @@ node_version_has_solaris_binary() {
|
||||||
NODE_VERSION="$1"
|
NODE_VERSION="$1"
|
||||||
# Error out if $NODE_VERSION is actually an io.js version
|
# Error out if $NODE_VERSION is actually an io.js version
|
||||||
local STRIPPED_IOJS_VERSION
|
local STRIPPED_IOJS_VERSION
|
||||||
STRIPPED_IOJS_VERSION="$(nvm_strip_iojs_prefix $NODE_VERSION)"
|
STRIPPED_IOJS_VERSION="$(nvm_strip_iojs_prefix "$NODE_VERSION")"
|
||||||
if [ "_$STRIPPED_IOJS_VERSION" != "_$NODE_VERSION" ]; then
|
if [ "_$STRIPPED_IOJS_VERSION" != "_$NODE_VERSION" ]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
@ -1493,7 +1493,7 @@ nvm() {
|
||||||
NVM_DEBUG_OUTPUT="$($NVM_DEBUG_COMMAND 2>&1)"
|
NVM_DEBUG_OUTPUT="$($NVM_DEBUG_COMMAND 2>&1)"
|
||||||
echo >&2 "$NVM_DEBUG_COMMAND: $(nvm_sanitize_path "$NVM_DEBUG_OUTPUT")"
|
echo >&2 "$NVM_DEBUG_COMMAND: $(nvm_sanitize_path "$NVM_DEBUG_OUTPUT")"
|
||||||
done
|
done
|
||||||
if [ "_$ZHS_HAS_SHWORDSPLIT_UNSET" = "_1" ] && nvm_has "unsetopt"; then
|
if [ "$ZHS_HAS_SHWORDSPLIT_UNSET" -eq 1 ] && nvm_has "unsetopt"; then
|
||||||
unsetopt shwordsplit
|
unsetopt shwordsplit
|
||||||
fi
|
fi
|
||||||
return 42
|
return 42
|
||||||
|
@ -1678,7 +1678,7 @@ nvm() {
|
||||||
local NVM_SUCCESS_MSG
|
local NVM_SUCCESS_MSG
|
||||||
if nvm_is_iojs_version "$VERSION"; then
|
if nvm_is_iojs_version "$VERSION"; then
|
||||||
NVM_PREFIX="$(nvm_iojs_prefix)"
|
NVM_PREFIX="$(nvm_iojs_prefix)"
|
||||||
NVM_SUCCESS_MSG="Uninstalled io.js $(nvm_strip_iojs_prefix $VERSION)"
|
NVM_SUCCESS_MSG="Uninstalled io.js $(nvm_strip_iojs_prefix "$VERSION")"
|
||||||
else
|
else
|
||||||
NVM_PREFIX="$(nvm_node_prefix)"
|
NVM_PREFIX="$(nvm_node_prefix)"
|
||||||
NVM_SUCCESS_MSG="Uninstalled node $VERSION"
|
NVM_SUCCESS_MSG="Uninstalled node $VERSION"
|
||||||
|
@ -1692,7 +1692,7 @@ nvm() {
|
||||||
echo "$NVM_SUCCESS_MSG"
|
echo "$NVM_SUCCESS_MSG"
|
||||||
|
|
||||||
# rm any aliases that point to uninstalled version.
|
# rm any aliases that point to uninstalled version.
|
||||||
for ALIAS in `command grep -l $VERSION "$(nvm_alias_path)/*" 2>/dev/null`
|
for ALIAS in `command grep -l "$VERSION" "$(nvm_alias_path)/*" 2>/dev/null`
|
||||||
do
|
do
|
||||||
nvm unalias "$(command basename "$ALIAS")"
|
nvm unalias "$(command basename "$ALIAS")"
|
||||||
done
|
done
|
||||||
|
@ -1918,7 +1918,7 @@ nvm() {
|
||||||
OUTPUT="$(nvm use "$VERSION" >/dev/null && node $ARGS)"
|
OUTPUT="$(nvm use "$VERSION" >/dev/null && node $ARGS)"
|
||||||
EXIT_CODE="$?"
|
EXIT_CODE="$?"
|
||||||
fi
|
fi
|
||||||
if [ $ZHS_HAS_SHWORDSPLIT_UNSET -eq 1 ] && nvm_has "unsetopt"; then
|
if [ "$ZHS_HAS_SHWORDSPLIT_UNSET" -eq 1 ] && nvm_has "unsetopt"; then
|
||||||
unsetopt shwordsplit
|
unsetopt shwordsplit
|
||||||
fi
|
fi
|
||||||
if [ -n "$OUTPUT" ]; then
|
if [ -n "$OUTPUT" ]; then
|
||||||
|
@ -1956,7 +1956,7 @@ nvm() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ $NVM_SILENT -eq 1 ] || echo "Running node $VERSION$(nvm_print_npm_version)"
|
[ $NVM_SILENT -eq 1 ] || echo "Running node $VERSION$(nvm_print_npm_version)"
|
||||||
NODE_VERSION="$VERSION" $NVM_DIR/nvm-exec "$@"
|
NODE_VERSION="$VERSION" "$NVM_DIR/nvm-exec" "$@"
|
||||||
;;
|
;;
|
||||||
"ls" | "list" )
|
"ls" | "list" )
|
||||||
local NVM_LS_OUTPUT
|
local NVM_LS_OUTPUT
|
||||||
|
@ -2181,7 +2181,7 @@ $NVM_LS_REMOTE_POST_MERGED_OUTPUT" | command grep -v "N/A" | command sed '/^$/d'
|
||||||
set +f; unset IFS # restore variable expansion in case $LINKS was empty
|
set +f; unset IFS # restore variable expansion in case $LINKS was empty
|
||||||
;;
|
;;
|
||||||
"clear-cache" )
|
"clear-cache" )
|
||||||
command rm -f $NVM_DIR/v* "$(nvm_version_dir)" 2>/dev/null
|
command rm -f "$NVM_DIR/v*" "$(nvm_version_dir)" 2>/dev/null
|
||||||
echo "Cache cleared."
|
echo "Cache cleared."
|
||||||
;;
|
;;
|
||||||
"version" )
|
"version" )
|
||||||
|
|
Loading…
Reference in New Issue