Do not fail is a user exists already
[mediagoblin.git] / devtools / update_translations.sh
index 1708e7e03881d20b3229a389c5aff5ac37bf34e9..29743f9465c6c93761bd76a8b903fe232675409f 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 # GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 Free Software Foundation, Inc
+# Copyright (C) 2011, 2012 GNU MediaGoblin contributors.  See AUTHORS.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU Affero General Public License as published by
@@ -27,8 +27,10 @@ git pull
 
 echo "==> pulling present translations"
 ./bin/tx pull -a
+
 git add mediagoblin/i18n/
-git commit -m "Committing present MediaGoblin translations before pushing extracted messages"
+git commit -m "Committing present MediaGoblin translations before pushing extracted messages" \
+    || true  # Don't fail if nothing to commit
 
 echo "==> Extracting translations"
 ./bin/pybabel extract -F babel.ini -o mediagoblin/i18n/en/LC_MESSAGES/mediagoblin.po .
@@ -36,6 +38,9 @@ echo "==> Extracting translations"
 echo "==> Pushing extracted translations to Transifex"
 ./bin/tx push -s
 
+echo "==> Waiting 5 seconds, so the server can process the new stuff (hopefully)"
+sleep 5
+
 # gets the new strings added to all files
 echo "==> Re-Pulling translations from Transifex"
 ./bin/tx pull -a
@@ -45,4 +50,7 @@ echo "==> Compiling .mo files"
 
 echo "==> Committing to git"
 git add mediagoblin/i18n/
-git commit -m "Committing extracted and compiled translations"
+
+git commit -m "Committing extracted and compiled translations" || true
+
+echo "... done.  Now consider pushing up those commits!"