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

nvm update? #127

Closed
ylluminate opened this issue Aug 8, 2012 · 9 comments
Closed

nvm update? #127

ylluminate opened this issue Aug 8, 2012 · 9 comments

Comments

@ylluminate
Copy link

Can we have some functionality in the way of updating nvm? For example, I would prefer to run nvm system update or perhaps how rvm works instead of running git pull within ~/.nvm:

Update RVM to latest development version:

rvm get head

or to stable version:

rvm get stable

update rubygems to latest available:

rvm rubygems latest

or just a version:

rvm rubygems 1.8.16
@creationix
Copy link
Collaborator

I'd rather not do this. It will cause more complexities and problems than good. Is it so hard to cd nvm && git pull when you want to upgrade your nvm version?

@ylluminate
Copy link
Author

Well oddly it does seem a bit complex. Every time I attempt to update nvm something blows up for some strange reason. Please do integrate an update function that guarantees that we'll run this properly. Obviously it should be simple, but something without fail and unequivocally get's in the way.

@koenpunt
Copy link
Contributor

koenpunt commented Apr 3, 2014

@ylluminate how do you update? And what are the problems you run into?

@ylluminate
Copy link
Author

Exactly as noted above. I had installed it via homebrew again for good measure, but ended up with the same problem. After removing it and then manually installing it again, it finally worked, but the problem revolved around git being b0rked. I don't have the session up now and I moved on, but the point was simply that if we had a more robust update mechanism that 100% always navigated to the proper folder and initiated the pull, it would be helpful in making sure the update mechanism is clear to users vs leaving question marks.

@mgol
Copy link
Contributor

mgol commented Jul 15, 2014

cd ~/.nvm && git pull would put one on a pre-release version that is highly discouraged; the whole command would be:

cd ~/.nvm && git pull && git checkout `git describe --abbrev=0 --tags`

Too fragile if you ask me.

@mgol
Copy link
Contributor

mgol commented Jul 19, 2014

I modified the command (the above one wasn't really working), now I use the following script to update nvm:

#!/bin/bash

set -u

git -C "$NVM_DIR" fetch --tags
TAG=$(git -C "$NVM_DIR" describe --tags `git -C "$NVM_DIR" rev-list --tags --max-count=1`)
echo "Checking out tag $TAG..."
git -C "$NVM_DIR" checkout "$TAG"

. "$NVM_DIR/nvm.sh"

EDIT: I updated the script to be safer.

@ljharb ljharb reopened this Jul 19, 2014
@xpepermint
Copy link

+1 for the @ylluminate's proposal

@brock brock mentioned this issue Sep 14, 2014
@ljharb
Copy link
Member

ljharb commented Sep 20, 2014

Duplicate of #400.

@ljharb ljharb closed this as completed Sep 20, 2014
@gabamnml
Copy link

gabamnml commented Oct 2, 2014

Would be good to implement as native command bash script that suggested by @mzgol

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

No branches or pull requests

7 participants