Skip to content

Instantly share code, notes, and snippets.

@msewell
Last active June 22, 2020 10:15
Show Gist options
  • Save msewell/d9b8a95076770c64061db96b5231d8c7 to your computer and use it in GitHub Desktop.
Save msewell/d9b8a95076770c64061db96b5231d8c7 to your computer and use it in GitHub Desktop.
Xcode behavior: run git client after successful test run
#!/bin/bash
cd $(dirname $XcodeProjectPath) # Xcode will fill $XcodeProjectPath with your project's path when run this script from an Xcode behavior
swiftlint autocorrect --config ~/Developer/.swiftlint.yml # Replace the path to your .swiftlint.yml if necessary (or leave it out entirely)
git diff-index --quiet HEAD || /usr/local/bin/stree $pwd # `stree` opens SourceTree, but can be replaced with your git client of choice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment