Skip to content

Commit

Permalink
Fix translate script with failure function
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaume Florez committed Mar 12, 2019
1 parent 0783c87 commit c5f0bc3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion translate.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#!/bin/bash

function build_failure {
echo "Failed to build, check mkdocs build!"
exit -1
}

pip install -r requirements.txt
if [ -f locales/messages.pot ]; then
echo "Erasing old pot file (local cache)..."
rm locales/messages.pot
fi
echo "Building docs to get new pot file..."
mkdocs build -f mkdocs_es.yml --clean || echo "Failed to build, check mkdocs build!" && exit -1
mkdocs build -f mkdocs_es.yml --clean || build_failure
echo "Merging pofiles..."
msgmerge -U locales/es_ES/LC_MESSAGES/messages.po locales/messages.pot
echo "Opening updated pofile with poedit..."
Expand Down

0 comments on commit c5f0bc3

Please sign in to comment.