Make scripts more portable

This commit is contained in:
heyarne 2021-04-07 07:18:17 +00:00 committed by Georg Krause
commit 39405bbc3e
7 changed files with 26 additions and 8 deletions

View file

@ -1,9 +1,13 @@
#!/bin/bash -eux
#!/usr/bin/env -S bash -eux
cd "$(dirname $0)/.." # change into base directory
source scripts/utils.sh
locales=$(tail -n +2 src/locales.js | sed -e 's/export default //' | jq '.locales[].code' | grep -v 'en_US' | xargs echo)
mkdir -p src/translations
for locale in $locales; do
$(yarn bin)/gettext-compile locales/$locale/LC_MESSAGES/app.po --output src/translations/$locale.json
$(npm_binaries)/gettext-compile locales/$locale/LC_MESSAGES/app.po --output src/translations/$locale.json
done
# find locales -name '*.po' | xargs $(yarn bin)/gettext-compile --output src/translations.json
# find locales -name '*.po' | xargs $(npm_binaries)/.bin/gettext-compile --output src/translations.json