Created
May 11, 2011 08:12
-
-
Save joelcox/966096 to your computer and use it in GitHub Desktop.
Add commit hash constant
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/bash | |
# Append the latest commit hash to your PHP constants file after the Git repository received a push. | |
# Path to constants file | |
CONST_PATH = ../../application/config/constants.php | |
# Ask git for the last abbreviated commit hash | |
HASH = `git log -1 --pretty=format:"%h"` | |
echo define \(\'COMMIT_HASH\', \'$HASH\'\)\; >> $CONST_PATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment