Permalink
Browse files

Use correct sed flags on all platforms

Close #1411
Close #1410
  • Loading branch information...
1 parent 0c3bed4 commit 79173426d51f8c7410f8922e92f4020eb587d983 @richo richo committed Dec 26, 2012
Showing with 8 additions and 2 deletions.
  1. +4 −1 scripts/functions/installer
  2. +4 −1 scripts/functions/utility
@@ -451,7 +451,10 @@ install_gemsets()
if
[[ -n "${rvm_without_gems:-}" ]]
then
- sed -E '/^('"${rvm_without_gems// /|}"')/ d' < "$gemset_file" > "$destination"
+ if [[ `uname -s` = "Darwin" ]]
+ then sed -E '/^('"${rvm_without_gems// /|}"')/ d' < "$gemset_file" > "$destination"
+ else sed -r '/^('"${rvm_without_gems// /|}"')/ d' < "$gemset_file" > "$destination"
+ fi
else
cp "$gemset_file" "$destination"
fi
@@ -193,7 +193,10 @@ __rvm_remove_from_path()
typeset _value
# remove multiple slashes https://github.com/wayneeseguin/rvm/issues/1364
- PATH="$(sed -E 's#/+#/#g' <<<$PATH)"
+ if [[ `uname -s` = "Darwin" ]]
+ then PATH="$(sed -E 's#/+#/#g' <<<$PATH)"
+ else PATH="$(sed -r 's#/+#/#g' <<<$PATH)"
+ fi
_value="${1//+(\/)//}"
typeset -a _path

0 comments on commit 7917342

Please sign in to comment.