Created
April 10, 2016 07:53
-
-
Save jpmartha/069ad1fa74a0ad3bd745d996311a7c74 to your computer and use it in GitHub Desktop.
Managing Swift Environments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo | |
echo "Before the change:" | |
xcrun --find swift | |
swift --version | |
echo | |
if [[ $PATH =~ /Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:* ]] | |
then | |
echo "You have already set the PATH." | |
else | |
export PATH=/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:$PATH | |
echo "PATH="$PATH | |
fi | |
if [[ $TOOLCHAINS = swift ]] | |
then | |
echo "You have already set the TOOLCHAINS." | |
else | |
export TOOLCHAINS=swift | |
echo "TOOLCHAINS="$TOOLCHAINS | |
fi | |
echo | |
echo "After the change:" | |
xcrun --find swift | |
swift --version | |
echo |
stewiebig69
commented
Sep 3, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment