File tree 1 file changed +8
-3
lines changed 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -111,12 +111,17 @@ error() {
111
111
exit 1
112
112
}
113
113
114
+ # isdarwin returns an error if the current platform is not darwin.
115
+ isdarwin () {
116
+ [[ " ${OSTYPE:- darwin} " == * darwin* ]]
117
+ }
118
+
114
119
libsh_bad_dependencies=0
115
120
116
121
if (( BASH_VERSINFO[0 ] < 4 )) ; then
117
122
libsh_bad_dependencies=1
118
123
log " ERROR: You need at least bash 4.0 to run the scripts in the Coder repo."
119
- if [[ " ${OSTYPE :- darwin} " == " darwin " ]] ; then
124
+ if isdarwin ; then
120
125
log " On darwin:"
121
126
log " - brew install bash"
122
127
log " - Restart your terminal"
128
133
if [[ " $( getopt --version) " == * --* ]]; then
129
134
libsh_bad_dependencies=1
130
135
log " ERROR: You need GNU getopt to run the scripts in the Coder repo."
131
- if [[ " ${OSTYPE :- darwin} " == " darwin " ]] ; then
136
+ if isdarwin ; then
132
137
log " On darwin:"
133
138
log " - brew install gnu-getopt"
134
139
# shellcheck disable=SC2016
@@ -146,7 +151,7 @@ make_version="$(make --version 2>/dev/null | head -n1 | grep -oE '([[:digit:]]+\
146
151
if [ " ${make_version// .*/ } " -lt 4 ]; then
147
152
libsh_bad_dependencies=1
148
153
log " ERROR: You need at least make 4.0 to run the scripts in the Coder repo."
149
- if [[ " ${OSTYPE :- darwin} " == " darwin " ]] ; then
154
+ if isdarwin ; then
150
155
log " On darwin:"
151
156
log " - brew install make"
152
157
# shellcheck disable=SC2016
You can’t perform that action at this time.
0 commit comments