From be64bd883ccad9e531e9289a2187efe1a20bf237 Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Mon, 1 Jun 2015 18:00:51 +0300 Subject: [PATCH] Fail gracefully when not running in a git environment. --- bump-js-versions.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bump-js-versions.sh b/bump-js-versions.sh index 798b9a7b3..e7d9aee53 100755 --- a/bump-js-versions.sh +++ b/bump-js-versions.sh @@ -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)