devtools: Use pybabel in virtualenv or on path depending on which is present.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Tue, 29 Mar 2016 19:00:28 +0000 (12:00 -0700)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Tue, 29 Mar 2016 19:00:28 +0000 (12:00 -0700)
* devtools/update_translations.sh (PYBABEL): New variable, points to
  whichever pybabel we should use.

devtools/update_translations.sh

index 29d3a5fc4f16aac10706ba6334c2d0f30cfd1c07..69313b5367f4c952e1be66a29c19a89323f759fe 100755 (executable)
 # exit if anything fails
 set -e
 
+if [ -f "./bin/pybabel" ]; then
+    PYBABEL="./bin/pybabel";
+else
+    PYBABEL=pybabel;
+fi
+
 echo "==> checking out master"
 git checkout master
 
@@ -29,7 +35,7 @@ echo "==> pulling present translations"
 rsync --exclude-from="devtools/pootle-exclude.txt" -vaz chapters.gnu.org::pootle/mediagoblin/ mediagoblin/i18n/
 
 echo "==> Extracting translations"
-./bin/pybabel extract -F babel.ini -o mediagoblin/i18n/templates/mediagoblin.pot .
+$PYBABEL extract -F babel.ini -o mediagoblin/i18n/templates/mediagoblin.pot .
 
 echo "==> Compiling .mo files"
 ./devtools/compile_translations.sh