Skip to content

Commit

Permalink
[Fix] remove nvm_supports_source_options
Browse files Browse the repository at this point in the history
Fixes #2387
  • Loading branch information
ljharb committed Jan 7, 2021
1 parent 9849bf4 commit 7ec025f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 45 deletions.
27 changes: 9 additions & 18 deletions nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3931,7 +3931,7 @@ nvm() {
nvm_has_system_node nvm_has_system_iojs \
nvm_download nvm_get_latest nvm_has nvm_install_default_packages nvm_get_default_packages \
nvm_curl_use_compression nvm_curl_version \
nvm_supports_source_options nvm_auto nvm_supports_xz \
nvm_auto nvm_supports_xz \
nvm_echo nvm_err nvm_grep nvm_cd \
nvm_die_on_prefix nvm_get_make_jobs nvm_get_minor_version \
nvm_has_solaris_binary nvm_is_merged_node_version \
Expand Down Expand Up @@ -4013,14 +4013,6 @@ nvm_install_default_packages() {
fi
}

nvm_supports_source_options() {
# shellcheck disable=SC1091,SC2240
[ "_$( . /dev/stdin yes 2> /dev/null <<'EOF'
[ $# -gt 0 ] && nvm_echo $1
EOF
)" = "_yes" ]
}

nvm_supports_xz() {
if [ -z "${1-}" ]; then
return 1
Expand Down Expand Up @@ -4108,15 +4100,14 @@ nvm_auto() {
nvm_process_parameters() {
local NVM_AUTO_MODE
NVM_AUTO_MODE='use'
if nvm_supports_source_options; then
while [ $# -ne 0 ]; do
case "$1" in
--install) NVM_AUTO_MODE='install' ;;
--no-use) NVM_AUTO_MODE='none' ;;
esac
shift
done
fi
while [ $# -ne 0 ]; do
case "$1" in
--install) NVM_AUTO_MODE='install' ;;
--no-use) NVM_AUTO_MODE='none' ;;
esac
shift
done
echo "${NVM_AUTO_MODE}!"
nvm_auto "${NVM_AUTO_MODE}"
}

Expand Down
27 changes: 0 additions & 27 deletions test/fast/Unit tests/nvm_supports_source_options

This file was deleted.

0 comments on commit 7ec025f

Please sign in to comment.