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

Comments

Projects
None yet
7 participants
@ylluminate
Copy link

ylluminate commented Aug 8, 2012

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

This comment has been minimized.

Copy link
Owner

creationix commented Aug 8, 2012

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?

@creationix creationix closed this Aug 8, 2012

@ylluminate

This comment has been minimized.

Copy link
Author

ylluminate commented Apr 3, 2014

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

This comment has been minimized.

Copy link
Contributor

koenpunt commented Apr 3, 2014

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

@ylluminate

This comment has been minimized.

Copy link
Author

ylluminate commented Apr 9, 2014

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

xpepermint commented Jul 24, 2014

+1 for the @ylluminate's proposal

@brock brock referenced this issue Sep 14, 2014

Closed

A "latest" tag #522

@ljharb

This comment has been minimized.

Copy link
Collaborator

ljharb commented Sep 20, 2014

Duplicate of #400.

@ljharb ljharb closed this Sep 20, 2014

@gabamnml

This comment has been minimized.

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