Unverified Commit d52ea372 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

macOS package: clean up connection test to github.com

— avoid outputing the whole Github page to install.log
— also make it more robust by directly testing return code
parent a42a9fff
#!/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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment