-
-
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
Consolidate and avoid sed/cut calls, clean up pattern matches #718
Conversation
local NVM_NUM_DOTS | ||
NVM_NUM_DOTS=$(echo "$VERSION" | command sed -e 's/[^\.]//g') | ||
NVM_NUM_DOTS="${VERSION//[^.]/}" |
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'm afraid this form of substitution is not an option as it doesn't work in dash
/sh
- this will fail tests.
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.
Ah yes. I've reverted this one.
VERSION="${VERSION#v*}" | ||
VERSION="${VERSION%\.}" | ||
VERSION="${VERSION#v}" | ||
VERSION="${VERSION%.}" |
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've made a functionality change here so that "v" and "." report 0 in c34502e, and incorporated these changes there. Apologies for the merge conflict :-/ a fresh rebase should sort it?
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.
Done; build is green now!
Some patterns contained a no-op `*`; the `*` would match the empty string because # or % replacement (unlike ## or %%) tries to find the shortest match.
Consolidate and avoid sed/cut calls, clean up pattern matches
Thanks! |
Are there tests for this? |
This commit hasn't been released yet, so your other issue wouldn't possibly be affected by it. But yes, there are tests. |
Some patterns contained a no-op
*
; the*
would match the empty stringbecause # or % replacement (unlike ## or %%) tries to find the shortest match.
(Follow up to #709.)