Last active
January 22, 2019 16:24
-
-
Save lottadot/4b65500de97a5d42358806c5cb892405 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
[ -f Cartfile.resolved ]; then | |
CARTFILE_CHANGED=`git diff --stat $(GIT_PREVIOUS_SUCCESSFUL_COMMIT) $(GIT_COMMIT) | grep '\|' | awk '{print $$1}' | grep Cartfile.resolved` | |
if test "$(CARTFILE_CHANGED)" ; then | |
echo "## STEP: Updating Carthage" | |
carthage bootstrap --platform iOS --no-use-binaries | |
else | |
echo "## Carthage is up to date" | |
fi | |
else | |
echo "## STEP: Installing Carthage Dependencies" | |
carthage bootstrap --platform iOS --no-use-binaries | |
fi |
@eseay
Thanks for the updated script. Your script did actually work. Did you encounter any issues when pushing an amended patchset? I'm getting a bad object error in the "CARTFILE_CHANGED=" line.
Shouldn't "carthage update" be used instead of "carthage bootstrap" when updating?
Carthage/Carthage#848 (comment)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I modified the code above to the following below. In order to get the script to run in the first place in my Jenkins setup, I needed to add the
#!/bin/sh
at the top as well as I needed to add theif
at the beginning of line one - a typo I imagine. As well, instead of()
for the variables, I opted to use{}
; for some reason the()
weren't working.Aside from syntactical changes, the main logical difference in my script is that it is ideal for situations when you check in your
Carthage/Checkouts
into version control for backup purposes. If you do that, then by checking forCarthage/Build
, you are able to determine whether or not Carthage dependencies have ever been built - something necessary for the first run. If they have never been built (meaning that folder is not in the workspace), then you need to go ahead and perform the bootstrap