-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
[Fix] Fix sed syntax error in nvm_command_info() #1528
Conversation
nvm.sh
Outdated
@@ -54,7 +54,7 @@ nvm_command_info() { | |||
local INFO | |||
COMMAND="${1}" | |||
if type "${COMMAND}" | command grep -q hashed; then | |||
INFO="$(type "${COMMAND}" | command sed -E 's/\(|)//g' | command awk '{print $4}')" | |||
INFO="$(type "${COMMAND}" | command sed -E 's/\(|\)//g' | command awk '{print $4}')" |
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.
Can you elaborate on this one? it doesn't seem to error out the sed
call when I try it locally.
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.
The origin one will cause error on GNU sed:
sed: -e expression #1, char 9: Unmatched ) or \)
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, I've reproduced it - do none of the current travis tests trigger this?
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 don't think we have test for that yet, won't mind that if you can directly add it.
@ljharb is there anything else I can do here? Thanks. |
I'd like to have a regression test before merging this. |
Any tip please? |
It seems like a unit test for |
Is there any regression test example exist in nvm right now so that I can take a look how should it looks like here? |
Just all the existing unit tests - what makes a test a "regression test" is merely that the test was added in response to a bug; to prevent a bug fix from "regressing" in the future. |
Oh, great, I misunderstood, thanks, just thinking about how the test would look like 🤔 |
75f7ddf
to
b445da0
Compare
@ljharb I'm sorry that I can't make it recently, with all due respect, as it's been a while, and we do locate the bug, know how to fix it, just lack of the test, I wonder if we can
It'll be great if we can get this bug fixed and landed in the recent release, thanks a lot. |
b445da0
to
af9732b
Compare
Just simply detect any standard error message in the test, as |
af9732b
to
8d296f8
Compare
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.
Seems like this will work!
No description provided.