Created
June 3, 2015 21:18
-
-
Save dpettigrew/851482c48e51acdd0eeb to your computer and use it in GitHub Desktop.
Script for conditionally calling "carthage update" or "carthage copy-frameworks" based upon modifications to the Cartfile
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/sh | |
export PATH=/opt/local/bin/:/opt/local/sbin:$PATH:/usr/local/bin: | |
carthagePath=`which carthage` | |
if [[ ! -f ${carthagePath} ]]; then | |
echo "ERROR: You need to install Carthage first, you can use brew to simplify process: | |
brew install carthage, OR, | |
download package from https://github.com/Carthage/Carthage" | |
exit 0; | |
fi | |
carthageFile="./Cartfile" | |
carthageFileTimestamp="./Cartfile.timestamp" | |
if [ "$carthageFileTimestamp" -ot "$carthageFile" ]; | |
then | |
echo Cartfile updated, performing carthage update | |
${carthagePath} update | |
touch -m -r "$carthageFile" "$carthageFileTimestamp" | |
else | |
${carthagePath} copy-frameworks | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment