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

Cannot create an alias to a version range #185

Closed
mgol opened this issue Jan 17, 2020 · 5 comments · Fixed by #201
Closed

Cannot create an alias to a version range #185

mgol opened this issue Jan 17, 2020 · 5 comments · Fixed by #201

Comments

@mgol
Copy link

mgol commented Jan 17, 2020

With nvm I could do this:

nvm alias default 12

and have the default always point to the latest installed 12.x.y version. With fnm this doesn't work, you have to provide a full version:

$ fnm default 12
Can't find a version installed in ~/.fnm/node-versions/v12/installation
$ ls ~/.fnm/node-versions/
v10.18.1 v12.14.1

In my experience, aliasing the default to a concrete Node version is not convenient. I want a specific major as different majors may have a breaking change but other than that, I want the latest.

@mgol mgol changed the title Cannot alias to a version range Cannot create an alias to a version range Jan 17, 2020
@Schniz
Copy link
Owner

Schniz commented Jan 19, 2020

Solving this will also provide infrastructure for solving #121. a function that resolves a version to all the possible versions might be helpful for both, something like (version: string) => list(string)

Then we can do

let resolveInstalledVersion = version =>
  switch (installedVersionsFor(version)) {
  | [] => Error(Version_not_found)
  | [version] => version
  | versions => Error(Too_many_versions_found(versions))
  }

And then we can "decorate" the input for both alias and uninstall

Are you interested in doing a PR? I'd be happy to help over discord is someone's interested!

@mgol
Copy link
Author

mgol commented Jan 27, 2020

Are you interested in doing a PR? I'd be happy to help over discord is someone's interested!

Unfortunately, I'm not familiar with ReasonML. :( I did do some Ocaml stuff back in the days at the university but I'm not sure how much I remember after all these years.

That said, if this doesn't require very substantial changes then maybe I'd be able to try something with some guidance.

@Schniz
Copy link
Owner

Schniz commented Feb 26, 2020

This is now possible thanks to @tatchi 😄

@waldyrious
Copy link
Contributor

waldyrious commented Feb 26, 2020

This is now possible thanks to @tatchi 😄

Just to make sure, was that in #191, right?

@tatchi
Copy link
Contributor

tatchi commented Feb 26, 2020

Hey,

I'm gonna try to implement this one :)

Schniz pushed a commit that referenced this issue Mar 9, 2020
Based on #194 to benefit from the `LocalVersionResolver` module. So I guess this PR should be merged first. This should fix #185
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants