nvm-sh / nvm

Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
MIT License
77.23k stars 7.76k forks source link

Shorter URL for install script? #1017

Open Efreak opened 8 years ago

Efreak commented 8 years ago

Can you add a gh-pages branch that with the download script? It would be nice to be able to just remember something like curl -o- http://creationix.githubio/nvm|bash than having to look up the install command each time. This is similar to get-pip.py and other tools.

Since github pages doesn't allow for automatic redirection rules (like grabbing the latestThis script could also probable be made to fetch the releases list and use that to get the latest tag. This way it would never need to be updated. Maybe something like:

curl -o- https://raw.githubusercontent.com/creationix/nvm/`curl -o- https://api.github.com/repos/creationix/nvm/releases -s| grep -m 1 tag_name|grep -oP 'v[\d\.]+'`/install.sh | bash
ljharb commented 8 years ago

This is related to #400 but not an exact duplicate, so I'll leave it open.

This could be achieved by keeping a latest tag and continuing to move it with every release, and using the URL https://raw.githubusercontent.com/creationix/nvm/latest/install.sh (which 404s right now).

However, I'm not so sure it's a good idea to enable people to blindly update their software to what might be a breaking version.

scic commented 8 years ago

We manage the nvm installation with a script for new computers. But now I have to manually track new releases and update the install URL each time. A version independent URL would be appreciated.

coreygo commented 6 years ago

I just installed via: curl -o- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash

Unless I'm mistaken, please correct me if I am, since install.sh#L14 is specifying the latest version number, using the raw master branch URL should work for installing and upgrading. I guess doing this through the latest tag is basically the same idea.

ljharb commented 6 years ago

@coreygo nope, if you use master, you will definitely risk getting a broken build. I break master all the time, sometimes on purpose, just to screw with people who are installing of of master.

You should only ever install from a tagged release.

coreygo commented 6 years ago

@ljharb I typically check install scripts and release notes beforehand but purposely breaking to screw with people seems... Eek.

ljharb commented 6 years ago

@coreygo i'm being a bit melodramatic :-) but it's more like, if i have major refactors going on, i do not think twice about pushing broken code to master, because master is for development, not for direct use.

coreygo commented 6 years ago

@ljharb Heh. No worries, I get that. I'd probably go with the latest tag method you mentioned and call it good.

coreygo commented 6 years ago

@ljharb Always amused how developers [randomly] agree on best practices… I've been clean installing, updating dotfiles, and I just finished installing Homebrew (which does use the raw master branch URL for the install script) when I noticed nvm hard coding the version. 😜