mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-12-20 04:04:20 +08:00
use regex triplet, add unit test
This commit is contained in:
2
nvm.sh
2
nvm.sh
@@ -98,7 +98,7 @@ nvm_format_version() {
|
||||
}
|
||||
|
||||
nvm_strip_path() {
|
||||
echo "$1" | sed -e "s#$NVM_DIR/[^/]*$2[^:]*##g" | sed -e "s/::/:/g" | sed -e "s/:$//g"
|
||||
echo "$1" | sed -e "s#$NVM_DIR/[^/]*$2[^:]*:##g" -e "s#:$NVM_DIR/[^/]*$2[^:]*##g" -e "s#$NVM_DIR/[^/]*$2[^:]*##g"
|
||||
}
|
||||
|
||||
nvm_binary_available() {
|
||||
|
||||
Reference in New Issue
Block a user