Provide an update_extlib.sh alternative for Guix.
[mediagoblin.git] / devtools / update_translations.sh
index 5a4275fdb0d99a6cc725df525e62b51954fd0dac..69313b5367f4c952e1be66a29c19a89323f759fe 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 # GNU MediaGoblin -- federated, autonomous media hosting
 # Copyright (C) 2011, 2012 GNU MediaGoblin contributors.  See AUTHORS.
 # exit if anything fails
 set -e
 
-## Maybe we'll uncomment these post-merge to master
+if [ -f "./bin/pybabel" ]; then
+    PYBABEL="./bin/pybabel";
+else
+    PYBABEL=pybabel;
+fi
 
-echo "==> checking out master"
-git checkout master
+echo "==> checking out master"
+git checkout master
 
-echo "==> pulling git master"
-git pull
+echo "==> pulling git master"
+git pull
 
 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