notes 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #!/usr/bin/env bash
  2. : rvm_scripts_path:${rvm_scripts_path:="$rvm_path/scripts"}
  3. : rvm_user_path:${rvm_user_path:="$rvm_path/user"}
  4. source "$rvm_scripts_path/initialize"
  5. source "$rvm_scripts_path/functions/logging"
  6. source "$rvm_scripts_path/functions/support"
  7. source "$rvm_scripts_path/functions/utility"
  8. if [[ "$1" == "initial" ]]
  9. then
  10. notes_type=Upgrade
  11. PAGER="\command \cat"
  12. new_notes()
  13. {
  14. \typeset file
  15. file="$rvm_path/config/displayed-notes.txt"
  16. \command \rm -f "${file}"
  17. tee "${file}" > /dev/null
  18. }
  19. elif [[ "$1" == "upgrade" ]]
  20. then
  21. notes_type=Upgrade
  22. PAGER="\command \cat"
  23. new_notes()
  24. {
  25. \typeset file
  26. file="$rvm_path/config/displayed-notes.txt"
  27. touch "${file}"
  28. tee "${file}.new" | (
  29. diff - "${file}" &&
  30. true
  31. ) | __rvm_sed -e '/^[^<]/ d' -e 's/^< //'
  32. printf "\n" >&2
  33. \command \mv -f "${file}.new" "${file}"
  34. }
  35. else
  36. notes_type=Installation
  37. new_notes()
  38. {
  39. \command \cat
  40. }
  41. fi
  42. # duplication marker kdfkjkjfdkfjdjkdfkjfdkj
  43. load_custom_flags()
  44. {
  45. if
  46. [[ -s "${rvm_path:-}/user/custom_flags" ]]
  47. then
  48. \typeset __key __value
  49. while IFS== read __key __value
  50. do
  51. eval "export ${__key}=\"\${__value}\""
  52. done < "${rvm_path:-}/user/custom_flags"
  53. fi
  54. }
  55. load_custom_flags
  56. # this block groups generated and static notes,
  57. # to add generated msgs put them below in code
  58. # for general messages put them in docs/upgrade-notes.md
  59. {
  60. if [[ -z "$1" ]]
  61. then
  62. printf "%b" "
  63. $notes_type Notes:
  64. "
  65. fi
  66. : rvm_scripts_path:${rvm_scripts_path:-$rvm_path/scripts}:
  67. \command \cat "$rvm_path/docs/upgrade-notes.md" | __rvm_sed \
  68. -e "s#\${SHELL}#${SHELL}#g" \
  69. -e "s#\${rvm_scripts_path}#${rvm_scripts_path}#g"
  70. printf "\n"
  71. source "$rvm_scripts_path/functions/notes/warnings/warning_loading_script"
  72. source "$rvm_scripts_path/functions/notes/warnings/warning_rvm_group"
  73. source "$rvm_scripts_path/functions/notes/warnings/warning_missing_devfd"
  74. source "$rvm_scripts_path/functions/notes/warnings/warning_apt_get_rvm"
  75. source "$rvm_scripts_path/functions/notes/warnings/warning_var"
  76. source "$rvm_scripts_path/functions/notes/warnings/warning_zsh"
  77. source "$rvm_scripts_path/functions/notes/warnings/warning_path_reset"
  78. source "$rvm_scripts_path/functions/notes/warnings/warning_gem_home"
  79. source "$rvm_scripts_path/functions/notes/warnings/warning_rvm_configure_env"
  80. source "$rvm_scripts_path/functions/notes/warnings/warning_gemrc"
  81. source "$rvm_scripts_path/functions/notes/warnings/warning_rvm_in_usr"
  82. source "$rvm_scripts_path/functions/notes/warnings/warning_needs_cleanup"
  83. } | new_notes | eval "${PAGER:-\command \cat}"
  84. source "$rvm_scripts_path/functions/notes/opencollective"