Преглед на файлове

Fail gracefully when not running in a git environment.

master
Boris Grozev преди 10 години
родител
ревизия
be64bd883c
променени са 1 файла, в които са добавени 9 реда и са изтрити 0 реда
  1. 9
    0
      bump-js-versions.sh

+ 9
- 0
bump-js-versions.sh Целия файл

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

Loading…
Отказ
Запис