Automatic swift SDK updates in Mac OS

Posted in software by Christopher R. Wirz on Mon Jun 16 2014

Mac OS provides a scripting environment within the terminal to automate tasks such as downloading the latest SDK and updating it. The script discussed in this post demonstrates downloading the latest Swift SDK from a developer and entering your API key.

Note: Repleace https://<domain>.com//<path-to-file>.swift with the URL to your SDK in the following example
"<please request an API key>" is the string in the file where your API key will be placed


echo starting…
OLD="<please request an API key>"
echo we will replace $OLD
echo with $NEW
echo $CWD is the current directory
echo $FILE is the file needing replacement
curl -O https://<domain>.com//<path-to-file>/<file-name>.swift
sed -i '' "s/$OLD/$NEW/g" $FILE

Now you can run the file by typing

Looking for a job?