From 6cfaede5a03cd4aa5d374d4c199bc1c18defa2e5 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sat, 27 Nov 2021 22:16:14 -0800 Subject: [PATCH] [Fix] `install`: better error message when xcode command line tools are needed Fixes #2697. Fixes #2663. --- install.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/install.sh b/install.sh index c3dc782..359d2de 100755 --- a/install.sh +++ b/install.sh @@ -356,6 +356,12 @@ nvm_do_install() { exit 1 fi fi + if nvm_has xcode-select && [ "$(xcode-select -p >/dev/null 2>/dev/null ; echo $?)" = '2' ] && [ "$(which git)" = '/usr/bin/git' ] && [ "$(which curl)" = '/usr/bin/curl' ]; then + nvm_echo >&2 'You may be on a Mac, and need to install the Xcode Command Line Developer Tools.' + # shellcheck disable=SC2016 + nvm_echo >&2 'If so, run `xcode-select --install` and try again. If not, please report this!' + exit 1 + fi if [ -z "${METHOD}" ]; then # Autodetect install method if nvm_has git; then