[Fix] `install`: better error message when xcode command line tools are needed

Fixes #2697. Fixes #2663.
Jordan Harband 2021-11-27 22:16:14 -08:00
parent 1875fe8b40
commit 6cfaede5a0
No known key found for this signature in database
GPG Key ID: 9F6A681E35EF8B56
1 changed files with 6 additions and 0 deletions

View File

@ -356,6 +356,12 @@ nvm_do_install() {
exit 1 exit 1
fi fi
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 if [ -z "${METHOD}" ]; then
# Autodetect install method # Autodetect install method
if nvm_has git; then if nvm_has git; then