Merge pull request #412 from koenpunt/fix-sed

Use sed -e instead of -E
master
Jordan Harband 2014-05-07 10:32:00 -07:00
commit 0ecb2879b9
2 changed files with 12 additions and 1 deletions

2
nvm.sh
View File

@ -98,7 +98,7 @@ nvm_format_version() {
}
nvm_strip_path() {
echo "$1" | sed -E "s#$NVM_DIR/[^/]*$2[^:]*:?##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() {

View File

@ -0,0 +1,11 @@
#!/bin/sh
die () { echo $@ ; exit 1; }
. ../../../nvm.sh
TEST_PATH=$NVM_DIR/v0.10.5/bin:/usr/bin:$NVM_DIR/v0.11.5/bin:$NVM_DIR/v0.9.5/bin:/usr/local/bin:$NVM_DIR/v0.2.5/bin
STRIPPED_PATH=`nvm_strip_path "$TEST_PATH" "/bin"`
[ "$STRIPPED_PATH" = "/usr/bin:/usr/local/bin" ] || die "Not correctly stripped: $STRIPPED_PATH "