Parcourir la source

Fail gracefully when not running in a git environment.

j8
Boris Grozev il y a 10 ans
Parent
révision
be64bd883c
1 fichiers modifiés avec 9 ajouts et 0 suppressions
  1. 9
    0
      bump-js-versions.sh

+ 9
- 0
bump-js-versions.sh Voir le fichier

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)

Chargement…
Annuler
Enregistrer