Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # make sure the script, named pre-commit, is in .git/hooks/ and is executable!
- EXIT_STATUS=1;
- MAIN_LAYOUT_FILE="path/to/main/layout.html._or_what_have_you";
- DATE_VERSION=`date '+%Y.%m%d.%H%M'`
- if [ -e $MAIN_LAYOUT_FILE ]
- then
- `sed -i "s/<span id='VERSION_ID'>.*<\/span>/<span id='VERSION_ID'>$DATE_VERSION<\/span>/" $MAIN_LAYOUT_FILE`;
- EXIT_STATUS=0;
- else
- echo "Missing layout file: $MAIN_LAYOUT_FILE\n";
- fi
- # if EXIT_STATUS != 0 it will stop the whole commit
- exit $EXIT_STATUS;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement