Created
August 14, 2013 14:24
-
-
Save jtpaasch/6231539 to your computer and use it in GitHub Desktop.
Checks if there are any new changes in a repo.
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
#!/bin/bash | |
# The git comamnd `git status --porcelain` | |
# will return a list of files that have changed. | |
# We'll redirect the output to /dev/null | |
# so that the results of the command don't get | |
# printed to the screen. | |
CHANGED=no | |
if git status --porcelain | >/dev/null ; then | |
CHANGED=yes | |
fi | |
# We could also pipe the command through a grep, | |
# if we want to check that certain files or folders | |
# have changed. | |
CHANGED=no | |
if git status --porcelain | grep 'app/public/assets' | >/dev/null ; | |
CHANGED=yes | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment