From a42ed77a7f192111180b26966f7e8b01cde01e00 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Thu, 5 Mar 2020 14:17:45 +0100
Subject: [PATCH] macOS installer: ensure git is in the path

---
 macOS/scripts/postinstall | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/macOS/scripts/postinstall b/macOS/scripts/postinstall
index f0ff9f4f56..f3d7ac16b3 100755
--- a/macOS/scripts/postinstall
+++ b/macOS/scripts/postinstall
@@ -60,6 +60,15 @@ fi
       exit 1; \
     }
 
+# Ensure git is in the path
+[[ -z $(which git) ]] && \
+    { \
+      osascript -e 'display alert "Dynare Installation Error" message "Not able to find Git even though the Command Line Tools have already been installed. This is likely a problem with your PATH environment variable.\n\nGit 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 $PATH; \
+      echo "Git not found in PATH"; \
+      exit 1; \
+    }
+
 # Install Homebrew
 BREWDIR="$2"/.brew
 [ -d "$BREWDIR" ] || mkdir -p "$BREWDIR"
-- 
GitLab