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

[New] adding default and alias option to `nvm install` #1929

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@kaltepeter
Contributor

kaltepeter commented Oct 22, 2018

For: nvm install 8.12.0 after install:

--alias=8 is equivalent to nvm alias 8 8.12.0
--default is equivalent to nvm alias default 8.12.0

implements #1867

[New] adding default and alias option to `nvm install`
For: `nvm install 8.12.0` after install:

--alias=8 is equivalent to `nvm alias 8 8.12.0`
--default is equivalent to `nvm alias default 8.12.0`

@kaltepeter kaltepeter force-pushed the kaltepeter:install-alias2 branch 3 times, most recently from 53b70d2 to d333130 Oct 22, 2018

nvm.sh Outdated
*)
break # stop parsing args
;;
esac
done
if [ -n "${ALIAS}" ]; then
nvm alias default "${ALIAS}"

This comment has been minimized.

@ljharb

ljharb Oct 22, 2018

Collaborator

The intention was that nvm install --alias=foo 8 would be like nvm install 8 && nvm alias foo 8 - in other words, --default is a shortcut for --alias=default.

Suggested change Beta
nvm alias default "${ALIAS}"
nvm alias "${ALIAS}" $provided_version

Separately, this step shouldn't happen until after the installation is completed.

@kaltepeter kaltepeter force-pushed the kaltepeter:install-alias2 branch from d333130 to f16600c Oct 23, 2018

@kaltepeter

This comment has been minimized.

Contributor

kaltepeter commented Oct 23, 2018

@ljharb This PR is now updated. Let me know if I missed something, I have issues with tests locally so a bit of a guessing game, it's still running CI.

#1928 is still closed and I thought was unsuccessfully opened this morning due to github flakiness. But the branch attached is up to date as well if you prefer that one.

@ljharb

Sorry for the delay on this one! I think one last change and we're good to go. (I've rebased your branch as well)

shift
;;
--alias=*)
ALIAS="${1##--alias=}"

This comment has been minimized.

@ljharb

ljharb Dec 4, 2018

Collaborator

Can we ensure that both --default and --alias are not provided, preferably by erroring out? (with a test)

@ljharb ljharb force-pushed the kaltepeter:install-alias2 branch from f16600c to 6918952 Dec 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment