-
-
Notifications
You must be signed in to change notification settings - Fork 1k
/
notes
executable file
·154 lines (125 loc) · 3.67 KB
/
notes
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/usr/bin/env bash
if ! typeset -f rvm_pretty_print >/dev/null 2>&1
then source "${rvm_scripts_path:-"$rvm_path/scripts"}/functions/logging"
fi
if [[ "$1" == "initial" ]]
then
notes_type=Upgrade
PAGER=cat
new_notes()
{
typeset file
file="$rvm_path/config/displayed-notes.txt"
rm -f "${file}"
tee "${file}" > /dev/null
}
elif [[ "$1" == "upgrade" ]]
then
notes_type=Upgrade
PAGER=cat
new_notes()
{
typeset file
file="$rvm_path/config/displayed-notes.txt"
touch "${file}"
tee "${file}.new" | (
diff --normal - "${file}" && \
printf " * No new notes to display.\n" >&2 || true
) | sed '/^[^<]/ d ; s/^< //'
mv -f "${file}.new" "${file}"
}
else
notes_type=Installation
new_notes()
{
cat
}
fi
if [[ "$1" == "upgrade" ]]
then
printf "%b" "
$notes_type Notes:
"
fi
# this block groups generated and static notes,
# to add generated msgs put them bellow in code
# for general messages put them in help/upgrade-notes.txt
{
if [[ -z "$1" ]]
then
printf "%b" "
$notes_type Notes:
"
fi
if [[ "$rvm_path" == "/usr/local/rvm" ]] || (( UID == 0 ))
then
printf "%b" "
* Please do NOT forget to add your users to the 'rvm' group.
The installer no longer auto-adds root or users to the rvm group. Admins must do this.
Also, please note that group memberships are ONLY evaluated at login time.
This means that users must log out then back in before group membership takes effect!
"
fi
: \
rvm_scripts_path:${rvm_scripts_path:-$rvm_path/scripts}:
cat "$rvm_path/help/upgrade-notes.txt" | sed \
-e "s/\${SHELL}/${SHELL//\//\/}/g" \
-e "s/\${rvm_scripts_path}/${rvm_scripts_path//\//\/}/g"
printf "\n"
if [[ -f /etc/profile.d/rvm.sh ]] &&
! GREP_OPTIONS="" \grep rvm_stored_umask /etc/profile.d/rvm.sh >/dev/null
then
printf "%b" "
* WARNING: your RVM loading script \`/etc/profile.d/rvm.sh\` is deprecated
and causes you to have \`umask g+w\` set in your shell,
run \`rvm get head --auto\` again to fix your scripts.
"
fi
if [[ "$rvm_path" == "/usr/share/ruby-rvm" ]]
then
printf "%b" "
* WARNING: You are using apt-get broken RVM, you should now:
sudo apt-get --purge remove ruby-rvm
sudo rm -rf /usr/share/ruby-rvm /etc/rvmrc /etc/profile.d/rvm.sh
open new terminal and validate environment is clean from old rvm settings:
env | GREP_OPTIONS="" \grep rvm
install RVM:
curl -L get.rvm.io | bash -s stable
"
fi
if [[ -n "${RUBYOPT:-""}" ]]
then
printf "%b" "
* WARNING: You have RUBYOPT set in your current environment.
This may cause rubies to not work as you expect them to as it is not supported
by all of them If errors show up, please try unsetting RUBYOPT first.
"
fi
if [[ -f ~/.profile ]] && ! [[ "$rvm_path" == "/usr/local/rvm" || $UID == 0 ]]
then
printf "%b" "
* WARNING: You're using ~/.profile, make sure you load it,
add the following line to ~/.bash_profile if it exists
otherwise add it to ~/.bash_login:
source ~/.profile
"
fi
if [[ -n "${ZSH_VERSION:-}" ]] &&
(( 65536 * ${ZSH_VERSION:0:1} + 256 * ${ZSH_VERSION:2:1} + ${ZSH_VERSION:4} != 262924 ))
then
printf "%b" "
* WARNING: ZSH 4.3.12 is recommended, you have $ZSH_VERSION.
"
fi
} | new_notes | eval "${PAGER:-cat}"
printf "%b" \
"
# RVM: Shell scripts enabling management of multiple ruby environments.
# RTFM: https://rvm.io/
# HELP: http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)
# Cheatsheet: http://cheat.errtheblog.com/s/rvm/
# Screencast: http://screencasts.org/episodes/how-to-use-rvm
"
rvm_log "
# In case of any issues read output of 'rvm requirements' and/or 'rvm notes'
"