/
rvm
36 lines (30 loc) · 901 Bytes
/
rvm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
if [[ -z "$rvm_prefix" ]] ; then unset rvm_prefix ; fi
if [[ -z "$rvm_path" ]] ; then unset rvm_path ; fi
if [[ -z "$rvm_prefix" ]] ; then
if [[ "root" = "$(whoami)" ]] ; then
rvm_prefix="/usr/local"
else
rvm_prefix="$HOME"
fi
fi
if [[ -z "$rvm_path" ]] ; then
unset rvm_path
if [[ "root" = "$(whoami)" ]] ; then
rvm_path="$rvm_prefix/rvm"
else
if [[ -d "$HOME/.rvm" ]] && [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
rvm_path="$HOME/.rvm"
elif [[ -d "$rvm_prefix/rvm" ]] && [[ -s "$rvm_prefix/rvm/scripts/rvm" ]] ; then
rvm_path="$rvm_prefix/rvm"
else
rvm_path="$HOME/.rvm"
fi
fi
fi
rvm_scripts_path="${rvm_scripts_path:-"$rvm_path/scripts"}"
source $rvm_scripts_path/rvm
unset rvm_interactive
rvm "$*"