Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save Ch00k/6241892 to your computer and use it in GitHub Desktop.
case "$(uname)" in
(SunOS)
case "$(uname -v)" in
(*joyent*)
gnu_tools_path=/opt/local/bin
;;
(*)
gnu_tools_path=/usr/gnu/bin
;;
esac
[[ -x $gnu_tools_path/grep ]] ||
rvm_error "ERROR: Missing GNU grep. Make sure it is installed in $gnu_tools_path/grep before using RVM!"
__rvm_grep()
{
GREP_OPTIONS="" $gnu_tools_path/grep "$@" || return $?;
}
for gnu_util in "${gnu_utils[@]}"
do
[[ -x $gnu_tools_path/$gnu_util ]] ||
rvm_error "ERROR: Missing GNU $gnu_util. Make sure it is installed in $gnu_tools_path/$gnu_util before using RVM!"
eval "__rvm_$gnu_util() { $gnu_tools_path/$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