66# If you'd like to override or set any custom environment variables, this .envrc will read a .env file at the end.
77set -e
88
9- # Upgrading Mac can uninstall the Command Line Tools, thus, removing our access to git
10- # The message talks about xcrun, however, we can use the lack of git as a way to know that we need this
11- # xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools),
12- # missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
13- if [ " $( uname -s) " == " Darwin" ] && [ ! -f " /Library/Developer/CommandLineTools/usr/bin/git" ]; then
14- echo -e " $( tput setaf 1) \nERROR: Complete the interactive installation (10+ mins) of the Command Line Tools.$( tput sgr0) "
15- xcode-select --install
16- return 1
17- fi
189
1910SENTRY_ROOT=" $(
2011 cd " $( dirname " ${BASH_SOURCE[0]} " ) "
@@ -23,11 +14,6 @@ SENTRY_ROOT="$(
2314
2415source " ${SENTRY_ROOT} /scripts/lib.sh"
2516
26- # XXX: we can't trap bash EXIT, because it'll override direnv's finalizing routines.
27- # consequently, using "exit" anywhere will skip this notice from showing.
28- # so need to use set -e, and return 1.
29- trap notice ERR
30-
3117complete_success=" yup"
3218
3319help_message () {
4632 help_message
4733}
4834
49- notice () {
50- [ $? -eq 0 ] && return
35+ onerr () {
36+ ret= $?
5137 failure_message
38+ return $ret
5239}
5340
5441debug () {
@@ -81,6 +68,21 @@ show_commands_info() {
8168
8269# ## Environment ###
8370
71+ # XXX: we can't trap bash EXIT, because it'll override direnv's finalizing routines.
72+ # consequently, using "exit" anywhere will skip this notice from showing.
73+ # so need to use set -e, and return 1.
74+ trap onerr ERR
75+
76+ # Upgrading Mac can uninstall the Command Line Tools, thus, removing our access to git
77+ # The message talks about xcrun, however, we can use the lack of git as a way to know that we need this
78+ # xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools),
79+ # missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
80+ if [ " $( uname -s) " == " Darwin" ] && [ ! -f " /Library/Developer/CommandLineTools/usr/bin/git" ]; then
81+ echo -e " ${red} \nERROR: Complete the interactive installation (10+ mins) of the Command Line Tools.${reset} "
82+ xcode-select --install
83+ return 1
84+ fi
85+
8486commands_to_run=()
8587
8688# Always write stdout immediately. Very helpful for debugging
0 commit comments