From 3e88528302d02d27e3b5cffd269c8544145744ba Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 13 Jul 2020 07:04:17 +0000 Subject: [PATCH] better error message for Mac and Linux --- git/install.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/git/install.sh b/git/install.sh index 68e66d6..c8c8495 100644 --- a/git/install.sh +++ b/git/install.sh @@ -1,8 +1,18 @@ #!/bin/bash +set -e +set -u + { - set -e - set -u - echo "This package doesn't work for Mac or Linux yet - only Windows 10" - exit 1 + if [ -z "$(command -v git)" ]; then + >&2 echo "Error: to install 'git' on Mac or Linux use the built-in package manager." + >&2 echo " for example: apt install -y git" + >&2 echo " for example: xcode-select --install" + # sudo xcodebuild -license accept + + exit 1 + else + echo "'git' already installed" + fi + } -- 2.25.1