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

Request: Add a --default option to install #1867

Closed
jcollum opened this issue Jul 16, 2018 · 6 comments · Fixed by #2274
Closed

Request: Add a --default option to install #1867

jcollum opened this issue Jul 16, 2018 · 6 comments · Fixed by #2274
Labels
feature requests I want a new feature in nvm! pull request wanted This is a great way to contribute! Help us out :-D

Comments

@jcollum
Copy link

jcollum commented Jul 16, 2018

It'd be nice if I could combine

✗ nvm install 8 && nvm alias default 8

into:

✗ nvm install --default 8

That's all 👍

@ljharb ljharb added the feature requests I want a new feature in nvm! label Jul 16, 2018
@ljharb
Copy link
Member

ljharb commented Jul 16, 2018

Seems like a reasonable request - we could also add --alias=foo (and have --default be a shortcut for --alias=default) to cover the generic case.

@ljharb ljharb added the pull request wanted This is a great way to contribute! Help us out :-D label Jul 16, 2018
@gitburd
Copy link
Contributor

gitburd commented Jul 29, 2020

@ljharb Some work was done on this issue here: #1929 but the issue was not closed. Is this something that still needs to be done?

@ljharb
Copy link
Member

ljharb commented Jul 29, 2020

@gitburd yes! it looks like #1929 (comment) still needs to be addressed.

If you'd like to rebase and update it, rather than opening up another PR, could you comment (here, or there) with a link to your branch, and I'll sync it with the PR?

@gitburd
Copy link
Contributor

gitburd commented Jul 29, 2020

@ljharb Great! working on that now.

@gitburd
Copy link
Contributor

gitburd commented Jul 30, 2020

@ljharb Here is my branch: https://github.com/gitburd/nvm/tree/add_default_alias_option
When I run this locally it only makes the alias in the alias=* cases if the version I am installing is already installed. Otherwise no alias is made.

@ljharb
Copy link
Member

ljharb commented Jul 30, 2020

@gitburd I'm a bit confused; you're saying that the --alias option is currently not working when installing a version?

(note that the test I requested on that PR still doesn't exist; namely that nvm install --default --alias=blah errors out prior to installing)

I've updated the PR with your rebased changes, and also added the runtime error when both are provided (or when --alias or --default are provided more than once).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature requests I want a new feature in nvm! pull request wanted This is a great way to contribute! Help us out :-D
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants