From 4b8fe75f9501c5880e613e3cd14c79de9d067e26 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Sun, 27 May 2018 17:48:52 +0200 Subject: [PATCH] Secure push-trad-to-zanata Test json files with python module to make sure they're valid before converting them to po Signed-off-by: Thomas Citharel Remove && --- Makefile | 2 +- scripts/locales.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 scripts/locales.sh diff --git a/Makefile b/Makefile index 2f4889c..4d4416d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ locales: - json2po -P -i locale/en.json -t locale/en.json -o po/framadate.pot + scripts/locales.sh push-locales: locales zanata-cli -q -B push diff --git a/scripts/locales.sh b/scripts/locales.sh new file mode 100755 index 0000000..47f00c9 --- /dev/null +++ b/scripts/locales.sh @@ -0,0 +1,9 @@ +#!/bin/bash +python -m json.tool < locale/en.json +if [[ $? == 0 ]]; +then + json2po -P -i locale/en.json -t locale/en.json -o po/framadate.pot +else + echo "Can't convert json files to po, the json file is incorrect" + exit 1 +fi