Quellcode durchsuchen

Fail gracefully when not running in a git environment.

j8
Boris Grozev vor 10 Jahren
Ursprung
Commit
be64bd883c
1 geänderte Dateien mit 9 neuen und 0 gelöschten Zeilen
  1. 9
    0
      bump-js-versions.sh

+ 9
- 0
bump-js-versions.sh Datei anzeigen

@@ -1,5 +1,14 @@
1 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 12
 # This script finds all js files included from index.html which have been
4 13
 # modified and bumps their version (the value of the "v" parameter used
5 14
 # in index.html)

Laden…
Abbrechen
Speichern