preinstall: correctly handle headless installs

This commit is contained in:
Sean Molenaar 2022-12-21 13:37:24 +01:00 committed by GitHub
parent f6a9980e49
commit d2aed31387
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,9 +5,12 @@ if [[ -e "/Library/Developer/CommandLineTools/usr/bin/git" ]]; then
exit 0 exit 0
fi fi
if /usr/bin/xcode-select --install; then if [[ -z "$COMMAND_LINE_INSTALL" ]]; then
exit 0 printf "No auto-install of CommandLine Tools in headless install!"
exit 1
fi fi
printf "Failed to install CommandLine Tools" if ! /usr/bin/xcode-select --install; then
exit 1 printf "Failed to install CommandLine Tools!"
exit 1
fi