Fail gracefully when not running in a git environment.

This commit is contained in:
Boris Grozev 2015-06-01 18:00:51 +03:00
parent 497c60375c
commit be64bd883c
1 changed files with 9 additions and 0 deletions

View File

@ -1,5 +1,14 @@
#!/bin/sh
if ! which git > /dev/null 2>&1 ;then
echo "Cannot find git executable, not bumping js versions."
exit
fi
if ! git status > /dev/null 2>&1 ;then
echo "Not a git repository, not bumping js versions."
exit
fi
# This script finds all js files included from index.html which have been
# modified and bumps their version (the value of the "v" parameter used
# in index.html)