-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Use $HOME variable in NVM_DIR #1381
Conversation
INSTALL_DIR="$(nvm_install_dir)" | ||
INSTALL_DIR="$( | ||
nvm_install_dir | | ||
command sed s:^$HOME:\$HOME: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this be done inside nvm_install_dir
? that would also make it more testable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to affect other functions which use nvm_install_dir
- I was intentionally trying to isolate this change to the place that needed it. I'm testing it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a fair point. I'd prefer to have this change covered by automated tests, if possible.
845903a
to
2f7f301
Compare
I had to use
It wanted me to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks great
Hey Guys, I think this has introduced a bug: Example: # old way
echo "${NVM_DIR:-"$HOME/.nvm"}"
/ubuntu/.nvm
# new way
printf %s "${NVM_DIR:-"$HOME/.nvm"}" | sed "s:^$HOME:\$HOME:"
$HOME/.nvm |
We are having the same issue as @lkysow. Looks like this introduced a bug. Specifically at https://github.com/DesignByOnyx/nvm/blob/1b2305232f878db80ded5450a5accc881d4e8752/install.sh#L81 where it creates the directory |
Thanks. Nobody should be using nvm off of master, only off of tagged releases, so this isn't urgent, but I'll take a look. |
The Jenkins NVM wrapper plugin explicitly is using Master at https://github.com/jenkinsci/nvm-wrapper-plugin/blob/f252c5fb55deeaf068ef4a21fc9bafbdc1c2b6f4/src/main/java/org/jenkinsci/plugins/nvm/NvmWrapperUtil.java#L122 That is how we encountered it |
Thanks, I'll file a bug. They shouldn't be doing that. |
Filed jenkinsci/nvm-wrapper-plugin#3 to try to fix that they're depending on an unstable version. |
@ljharb - my original PR isolated this change to the code which writes to the profile file. I can revert back to that if you like. Still need to fix the Jenkins thing, but the only place we really need literal |
@DesignByOnyx if you'd be willing to open a PR that fixes the issue without reverting the feature, that'd be great! |
Closes #1346