forked from rvm/rvm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes
executable file
·103 lines (84 loc) · 2.65 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
#!/usr/bin/env bash
: rvm_scripts_path:${rvm_scripts_path:="$rvm_path/scripts"}
: rvm_user_path:${rvm_user_path:="$rvm_path/user"}
source "$rvm_scripts_path/initialize"
source "$rvm_scripts_path/functions/logging"
source "$rvm_scripts_path/functions/support"
source "$rvm_scripts_path/functions/utility"
if [[ "$1" == "initial" ]]
then
notes_type=Upgrade
PAGER="\command \cat"
new_notes()
{
\typeset file
file="$rvm_path/config/displayed-notes.txt"
\command \rm -f "${file}"
tee "${file}" > /dev/null
}
elif [[ "$1" == "upgrade" ]]
then
notes_type=Upgrade
PAGER="\command \cat"
new_notes()
{
\typeset file
file="$rvm_path/config/displayed-notes.txt"
touch "${file}"
tee "${file}.new" | (
diff - "${file}" &&
true
) | __rvm_sed -e '/^[^<]/ d' -e 's/^< //'
printf "\n" >&2
\command \mv -f "${file}.new" "${file}"
}
else
notes_type=Installation
new_notes()
{
\command \cat
}
fi
# duplication marker kdfkjkjfdkfjdjkdfkjfdkj
load_custom_flags()
{
if
[[ -s "${rvm_path:-}/user/custom_flags" ]]
then
\typeset __key __value
while IFS== read __key __value
do
eval "export ${__key}=\"\${__value}\""
done < "${rvm_path:-}/user/custom_flags"
fi
}
load_custom_flags
# this block groups generated and static notes,
# to add generated msgs put them below in code
# for general messages put them in docs/upgrade-notes.md
{
if [[ -z "$1" ]]
then
printf "%b" "
$notes_type Notes:
"
fi
: rvm_scripts_path:${rvm_scripts_path:-$rvm_path/scripts}:
\command \cat "$rvm_path/docs/upgrade-notes.md" | __rvm_sed \
-e "s#\${SHELL}#${SHELL}#g" \
-e "s#\${rvm_scripts_path}#${rvm_scripts_path}#g"
printf "\n"
source "$rvm_scripts_path/functions/notes/warnings/warning_loading_script"
source "$rvm_scripts_path/functions/notes/warnings/warning_rvm_group"
source "$rvm_scripts_path/functions/notes/warnings/warning_missing_devfd"
source "$rvm_scripts_path/functions/notes/warnings/warning_apt_get_rvm"
source "$rvm_scripts_path/functions/notes/warnings/warning_var"
source "$rvm_scripts_path/functions/notes/warnings/warning_zsh"
source "$rvm_scripts_path/functions/notes/warnings/warning_path_reset"
source "$rvm_scripts_path/functions/notes/warnings/warning_gem_home"
source "$rvm_scripts_path/functions/notes/warnings/warning_rvm_configure_env"
source "$rvm_scripts_path/functions/notes/warnings/warning_gemrc"
source "$rvm_scripts_path/functions/notes/warnings/warning_rvm_in_usr"
source "$rvm_scripts_path/functions/notes/warnings/warning_needs_cleanup"
} | new_notes | eval "${PAGER:-\command \cat}"
source "$rvm_scripts_path/functions/notes/opencollective"