Skip to content

Instantly share code, notes, and snippets.

@Ch00k
Created August 15, 2013 10:51
Show Gist options
  • Select an option

  • Save Ch00k/6239969 to your computer and use it in GitHub Desktop.

Select an option

Save Ch00k/6239969 to your computer and use it in GitHub Desktop.
case "$(uname)" in
(SunOS)
[[ -x /usr/gnu/bin/grep || -x /opt/local/bin/grep ]] ||
rvm_error "ERROR: Missing GNU grep. Make sure it is installed in either /usr/gnu/bin/grep or /opt/local/bin/grep before using RVM!"
__rvm_grep()
{
GREP_OPTIONS="" /usr/gnu/bin/grep "$@" ||
GREP_OPTIONS="" /opt/local/bin/grep "$@" || return $?;
}
for gnu_util in "${gnu_utils[@]}"
do
[[ -x /usr/gnu/bin/$gnu_util || -x /opt/local/bin/$gnu_util ]] ||
rvm_error "ERROR: Missing GNU $gnu_util. Make sure it is installed in either /usr/gnu/bin/$gnu_util or /opt/local/bin/$gnu_util before using RVM!"
eval "__rvm_$gnu_util() { /usr/gnu/bin/$gnu_util \"\$@\" || /opt/local/bin/$gnu_util \"\$@\" || return \$?; }"
done
;;
(*)
__rvm_grep()
{
GREP_OPTIONS="" \grep "$@" || return $?
}
for gnu_util in "${gnu_utils[@]}"
do
eval "__rvm_$gnu_util() { \\$gnu_util \"\$@\" || return \$?; }"
done
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment