Skip to content

Commit 208eaf4

Browse files
author
Chris Maunder
committed
Corrected check for macOS
1 parent eb4cfbb commit 208eaf4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/setup.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ if [ "$launchedBy" = "server" ]; then attemptSudoWithoutAdminRights=false; fi
197197
# scripts won't simply fail. For Docker and macOS we create a no-op proxy. For
198198
# others, we install the Real Deal
199199
if ! command -v sudo &> /dev/null; then
200-
if [ "$inDocker" = true ] || [ "$os" = "macos" ]; then
200+
if [ "$inDocker" = true ] || [[ $OSTYPE == 'darwin'* ]]; then
201201
cat > "/usr/sbin/sudo" <<EOF
202202
#!/bin/sh
203203
\${@}
@@ -603,7 +603,8 @@ function correctLineEndings () {
603603

604604
local filePath="$1"
605605

606-
# Force correct BOM and CRLF issues in the script. Just in case
606+
# Force correct BOM and CRLF issues in the script. Just in case. We don't
607+
# use the $os var here because it may not have been set yet
607608
if [[ $OSTYPE == 'darwin'* ]]; then # macOS.
608609
darwinVersion=$(echo "$OSTYPE" | cut -d '.' -f 1)
609610
if [[ ${darwinVersion} -ge 13 ]]; then # Sonoma 14.3 is 'darwin23.2.1' -> '23'

0 commit comments

Comments
 (0)