Created
August 18, 2014 01:06
-
-
Save tbnorth/6f2611b0fe42faaba690 to your computer and use it in GitHub Desktop.
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
@language unknown_language | |
#!/bin/sh | |
# http://stackoverflow.com/questions/3878624/how-do-i-programmatically-determine-if-there-are-uncommited-changes | |
if git diff-index --cached --quiet HEAD --ignore-submodules -- ; then | |
echo Version info script sees nothing to do | |
exit | |
fi | |
cat >leo/core/commit_timestamp.json << EOT | |
{ | |
"asctime": "$(date)", | |
"timestamp": "$(date '+%Y%m%d%H%M%S')" | |
} | |
EOT | |
echo Updating version info | |
sleep 1 | |
git add leo/core/commit_timestamp.json | |
@language unknown_language | |
#!/bin/sh | |
TS=$(grep timestamp leo/core/commit_timestamp.json | sed 's/.*: "//; s/"//') | |
echo >> "$1" | |
echo Leo build: $TS >> "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment