Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to consoleui on MacOSX Catalina #2911

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion macosx/CKAN
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
#!/bin/bash

supports_32_bit() {
MACOS_VER=$(sw_vers -productVersion)
MAJOR=$(echo $MACOS_VER | cut -d. -f1)
MINOR=$(echo $MACOS_VER | cut -d. -f2)
# 9.X => true
if (( $MAJOR < 10 ))
then
return 0
fi
# 11.X => false
if (( $MAJOR > 10 ))
then
return 1
fi
# 10.15+ => false
if (( $MINOR >= 15 ))
then
return 1
fi
return 0
}

# Check El Capitan's Mono install location
# And Mono 5's install location
# And the configured location in /etc/paths.d
Expand Down Expand Up @@ -42,5 +64,15 @@ else
export GDIPLUS_NOX=1
export DYLD_FALLBACK_LIBRARY_PATH="$MACOS_PATH:$MONO_FRAMEWORK_PATH/lib:/lib:/usr/lib"

"$MONO" "$MONO_ARGS" "$ASSEMBLY" "$@"
# Default to consoleui on Catalina and later if they double click
if ! supports_32_bit && [[ "$@" == "" ]]
then
osascript <<END
tell application "Terminal"
do script "cd \"`pwd`\"; \"$MONO\" \"$ASSEMBLY\" consoleui"
end tell
END
else
"$MONO" "$MONO_ARGS" "$ASSEMBLY" "$@"
fi
fi