-
-
Save Nyoho/33828aeff9ed3e486646aa6a1871c12e to your computer and use it in GitHub Desktop.
A Shell to download and install Swift Development Snapshots from Swift.org
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
#!/usr/bin/env bash | |
DEVELOPMENT_SNAPSHOTS_PATH=https://swift.org/builds/development/xcode | |
DEVELOPMENT_SNAPSHOTS_PREFIX=swift-DEVELOPMENT-SNAPSHOT- | |
echo | |
if [ -z "$1" ]; then | |
echo "OVERVIEW: Download and install Swift Development Snapshots from Swift.org." | |
echo | |
echo "USAGE: get-swift-pkg [development-snapshots-name]" | |
echo | |
echo "Example: get-swift-pkg 2016-03-24-a" | |
echo | |
echo "Available development-snapshots-names are ..." | |
curl -s https://swift.org/download/|grep xcode/swift-DEVELOPMENT-SNAPSHOT | sed -n 's/^.*href="\/builds\/development\/xcode\/swift-DEVELOPMENT-SNAPSHOT-\([^"]*\)\/.*".*$/\1/p' | uniq | |
exit 1 | |
fi | |
DEVELOPMENT_SNAPSHOTS_NAME=$DEVELOPMENT_SNAPSHOTS_PREFIX"$1" | |
curl -O\# $DEVELOPMENT_SNAPSHOTS_PATH/$DEVELOPMENT_SNAPSHOTS_NAME/$DEVELOPMENT_SNAPSHOTS_NAME-osx.pkg | |
sudo installer -pkg $DEVELOPMENT_SNAPSHOTS_NAME-osx.pkg -target / | |
rm $DEVELOPMENT_SNAPSHOTS_NAME-osx.pkg | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment