1
0
Fork 0
mirror of https://github.com/eosswedenorg/eosio-keygen-extras synced 2026-06-18 05:20:01 +02:00
eosio-keygen-extras/update-dict.sh
Henrik Hautakoski a26b8543d1 Initial commit (taken from eosio-keygen repo)
eosio-keygen commit: 2c9c3d2ed979b7a0d324303e746ab715e3c6abee
2020-05-29 13:59:48 +02:00

25 lines
564 B
Bash

#!/usr/bin/env bash
# Updates the dictionary files defined in config.json.
BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
EXTRAS_DIR=${BASE_DIR}/../extras
CONFIG=${EXTRAS_DIR}/dict.json
for lang in $(jq -r 'keys[]' $CONFIG); do
echo "- Generating: $lang"
files=()
for f in $(jq -r ".$lang | if type==\"array\" then .[] else . end" $CONFIG); do
if [ "${f:0:1}" != "/" ]; then
f="$EXTRAS_DIR/$f"
fi
files+=( "$f" )
done
grep -hs ^ ${files[@]} | $BASE_DIR/generate-dict.sh > $EXTRAS_DIR/dict/$lang
done
echo "Done"