Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process additional (--) parameters before final version parameter. #1957

Open
wants to merge 7 commits into
base: master
from

Parse parameter in more straight forward way. Add failing case for mi…

…ssing value on alias --copy-packages-from same as on --reinstall-packages-from.
  • Loading branch information...
Bickel, Korbin
Bickel, Korbin committed Dec 13, 2018
commit 412b4bdd7f1db720bcac1bb508eedf102c668bdb
8 nvm.sh
@@ -2516,7 +2516,7 @@ nvm() {
NVM_UPGRADE_NPM=1
;;
--reinstall-packages-from=*)
PROVIDED_REINSTALL_PACKAGES_FROM="$(nvm_echo "$1" | command cut -c 27-)"
PROVIDED_REINSTALL_PACKAGES_FROM="${1##--reinstall-packages-from=}"
if [ -z "${PROVIDED_REINSTALL_PACKAGES_FROM}" ]; then
nvm_err 'If --reinstall-packages-from is provided, it must point to an installed version of node.'
return 6
@@ -2528,9 +2528,13 @@ nvm() {
return 6
;;
--copy-packages-from=*)
PROVIDED_REINSTALL_PACKAGES_FROM="$(nvm_echo "$1" | command cut -c 22-)"
PROVIDED_REINSTALL_PACKAGES_FROM="${1##--copy-packages-from=}"
REINSTALL_PACKAGES_FROM="$(nvm_version "$PROVIDED_REINSTALL_PACKAGES_FROM")" ||:
;;
--copy-packages-from)
nvm_err 'If --copy-packages-from is provided, it must point to an installed version of node using `=`.'
return 6
;;
--skip-default-packages)
SKIP_DEFAULT_PACKAGES=true
;;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.