Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check to see if Xcode commandlinetools already installed #95

Open
jelockwood opened this issue Aug 31, 2022 · 0 comments
Open

Add check to see if Xcode commandlinetools already installed #95

jelockwood opened this issue Aug 31, 2022 · 0 comments

Comments

@jelockwood
Copy link

As far as I can see the existing script to install Xcode commandlinttools does not do a check to see if these tools are already installed. Apart from the potential fact that this would unnecessarily reinstall the tools if they are already installed there is also the possibility that the touch command used will at least temporarily overwrite part of the tools.

Apple have unfortunately made it harder than it need be to via a script determine if the tools are already installed, sadly a trend that seems to be more and more common these days with Apple.

However the following script does I believe provide a reliable method of checking.

Basically it boils down to using the well known xcode-select -p command but makes it clearer that this command returns 0 if they are NOT installed and 1 if they ARE installed. These numbers are normally only output to stderr and hence not normally visible.

I am suggesting that similar code be added to the script written by @rtrouton

#!/bin/sh

if ! command xcode-select -p &> /dev/null
then
	echo $?
    echo "\t xcode was not found! You need to manually install it :/ "
else
	echo $?
    echo "xcode is installed, checking other IOS build tools"
fi
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant