Skip to content
Myr

Merge pull request #412 from koenpunt/fix-sed

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Use sed -e instead of -E

authored by Jordan Harband · committed by Jordan Harband · parents 7f3a794, e3b8449 · Browse files · 2 files+12 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+12 added−1 removed

  • tests:+11 added−0 removed
  • other:+1 added−1 removed

2 files+12 added−1 removed

added:test/fast/Unit tests/nvm_strip_path+11 added
1#!/bin/sh23die () { echo $@ ; exit 1; }45. ../../../nvm.sh67TEST_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/bin89STRIPPED_PATH=`nvm_strip_path "$TEST_PATH" "/bin"`1011[ "$STRIPPED_PATH" = "/usr/bin:/usr/local/bin" ] || die "Not correctly stripped: $STRIPPED_PATH "
modified:nvm.sh+1 added-1 removed
96 unmodified lines
97 echo "$1" | sed -e 's/^\([0-9]\)/v\1/g'98}99100nvm_strip_path() {101 echo "$1" | sed -E "s#$NVM_DIR/[^/]*$2[^:]*:?##g"101 echo "$1" | sed -e "s#$NVM_DIR/[^/]*$2[^:]*:##g" -e "s#:$NVM_DIR/[^/]*$2[^:]*##g" -e "s#$NVM_DIR/[^/]*$2[^:]*##g"102}103104nvm_binary_available() {105 # binaries started with node 0.8.6
524 unmodified lines