From d52ea372db54360ba5b697dfaad18cbe30e2bbbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Tue, 23 Mar 2021 18:17:33 +0100 Subject: [PATCH] macOS package: clean up connection test to github.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit — avoid outputing the whole Github page to install.log — also make it more robust by directly testing return code --- macOS/scripts/postinstall | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/macOS/scripts/postinstall b/macOS/scripts/postinstall index 42b00a4f2b..0c6e3e5923 100755 --- a/macOS/scripts/postinstall +++ b/macOS/scripts/postinstall @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright © 2019-2020 Dynare Team +# Copyright © 2019-2021 Dynare Team # # This file is part of Dynare. # @@ -29,12 +29,11 @@ exec 2>&1 rm -f "$2"/dummy # Test for Internet connection -[[ -z $(curl -s -m 4 https://github.com) ]] && \ - { \ - osascript -e 'display alert "Dynare Installation Error" message "Not able to connect to github.com. Either you are not connected to the internet or github.com is blocked where you are.\n\nAccess to GitHub is necessary to make Dynare work with the `use_dll` option on macOS.\n\nIf you cannot establish this connection or do not want to use the `use_dll` option of Dynare, please run the installer again and choose \"Customize\" from the \"Installation Type\" screen and uncheck the `GCC` option." as critical'; \ - echo "No internet connection to github.com"; \ - exit 1; \ - } +if ! curl -s -m 4 https://github.com >/dev/null; then + osascript -e 'display alert "Dynare Installation Error" message "Not able to connect to github.com. Either you are not connected to the internet or github.com is blocked where you are.\n\nAccess to GitHub is necessary to make Dynare work with the `use_dll` option on macOS.\n\nIf you cannot establish this connection or do not want to use the `use_dll` option of Dynare, please run the installer again and choose \"Customize\" from the \"Installation Type\" screen and uncheck the `GCC` option." as critical' + echo "No internet connection to github.com" + exit 1 +fi # Install Command Line Tools if [[ -z $(/usr/bin/xcode-select -print-path) ]]; then -- GitLab