From 9433b206910ca6b8f9153c6418005cee0a0fd9fc Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Sat, 2 Nov 2019 10:02:13 -0500 Subject: [PATCH] Default to consoleui on MacOSX Catalina --- macosx/CKAN | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/macosx/CKAN b/macosx/CKAN index 04d8dfb298..8d1398ced1 100755 --- a/macosx/CKAN +++ b/macosx/CKAN @@ -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 @@ -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 <