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

install.sh cd-ing glitch when nvm is already installed #1137

Closed
cspotcode opened this issue Jun 30, 2016 · 6 comments
Closed

install.sh cd-ing glitch when nvm is already installed #1137

cspotcode opened this issue Jun 30, 2016 · 6 comments
Labels
installing nvm Problems installing nvm itself

Comments

@cspotcode
Copy link

cspotcode commented Jun 30, 2016

Reproduction: run the following so that the second time, install.sh detect that nvm is already installed.

$ NVM_DIR=nvm-dir ./install.sh
$ NVM_DIR=nvm-dir ./install.sh

This happens:

=> nvm is already installed in ./nvm-dir, trying to update using git
=> bash: line 72: cd: ./nvm-dir: No such file or directory
bash: line 73: cd: ./nvm-dir: No such file or directory

This happens because line 62 has already cd-ed to nvm-dir.

EDIT: a quick fix would be for line 62 to pushd and then popd immediately afterwards.

@ljharb
Copy link
Member

ljharb commented Jun 30, 2016

Hmm, I'm not able to reproduce that. In what directory are you running install.sh from?

I do see the logical issue in the code - that should be trivial to fix.

@cspotcode
Copy link
Author

I'm running it in /Users/cspotcode/Desktop/nvm-test/. I have git installed, so the install script is using git instead of wget or curl; maybe that's the difference between my system and yours?

@ljharb
Copy link
Member

ljharb commented Jun 30, 2016

Pretty sure I have git installed ;-)

So you've downloaded install.sh to that dir, and you're pointing NVM_DIR to another empty/nonexistent dir?

@cspotcode
Copy link
Author

Here's a full reproduction case. I'm running Mac OSX 10.10.5.

cd ~/Desktop
mkdir issue1137
cd issue1137
mkdir custom-nvm-dir
touch profile
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.2/install.sh | NVM_DIR=custom-nvm-dir PROFILE=../profile bash
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.2/install.sh | NVM_DIR=custom-nvm-dir PROFILE=../profile bash

@ljharb ljharb closed this as completed in cb4e010 Jun 30, 2016
@ljharb
Copy link
Member

ljharb commented Jun 30, 2016

Thanks! When I run

cd ~/Desktop
mkdir -p issue1137
cd issue1137
mkdir -p custom-nvm-dir
touch profile
curl -o- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | NVM_DIR=custom-nvm-dir PROFILE=../profile bash
curl -o- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | NVM_DIR=custom-nvm-dir PROFILE=../profile bash

I do still see bash: line 85: cd: custom-nvm-dir: No such file or directory

@ljharb ljharb reopened this Jun 30, 2016
@ljharb ljharb closed this as completed in 43c3c23 Jun 30, 2016
@ljharb
Copy link
Member

ljharb commented Jun 30, 2016

K, should be all fixed in latest master, which will be in the next release.

@ljharb ljharb added installing node Issues with installing node/io.js versions. installing nvm Problems installing nvm itself and removed installing node Issues with installing node/io.js versions. labels Jun 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing nvm Problems installing nvm itself
Projects
None yet
Development

No branches or pull requests

2 participants