From: AJ ONeal Date: Sat, 27 Mar 2021 05:17:54 +0000 (-0600) Subject: git: show either the Mac or the Linux message (not both) X-Git-Url: https://git.josue.xyz/?p=webi-installers%2F.git;a=commitdiff_plain;h=79818b7628891a8e51fefe2704869438f7e5aebc git: show either the Mac or the Linux message (not both) --- diff --git a/git/install.sh b/git/install.sh index c8c8495..98bcf63 100644 --- a/git/install.sh +++ b/git/install.sh @@ -2,17 +2,22 @@ set -e set -u -{ +function __init_git() { 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 - + if [[ -n "$(uname -a | grep -i darwin)" ]]; then + >&2 echo "Error: 'git' not found. You may have to re-install 'git' on Mac after every major update." + >&2 echo " for example, try: xcode-select --install" + # sudo xcodebuild -license accept + else + >&2 echo "Error: to install 'git' on Linux use the built-in package manager." + >&2 echo " for example, try: xcode-select --install" + fi exit 1 else echo "'git' already installed" fi } + +__init_git()