Files
jquery.uls/scripts/fetch-language-data.sh
Amir E. Aharoni d7cbd0a03d Fixes for fetch-language-data.sh (#360)
* Fixes for fetch-language-data.sh

* Portable path function, instead of `readlink -f`, which doesn't
  work on mac.
* Remove extra '/' character from DEST. It is added again later.
* Change "wrote" to "written" — clearer meaning of what was done.

* Update language-data

* Update sjd autonym
* Move ms-arab a few lines (automatic change from CLDR)

Updating to
b485f5a134
2020-04-08 20:16:23 +05:30

35 lines
862 B
Bash
Executable File

#!/bin/bash
set -o errexit -o nounset -o pipefail
scriptdir() { perl -MCwd -e 'print Cwd::abs_path shift;' "$1"; }
BASEDIR=$(dirname "$(dirname "$(scriptdir "$0")")")
DEST="$BASEDIR/src"
CLONEDIR="$BASEDIR/vendor/language-data"
UPSTREAM="https://github.com/wikimedia/language-data.git"
echo "Getting latest language-data from $UPSTREAM"
if [ -d "$CLONEDIR" ]
then (
cd "$CLONEDIR"
git pull
) else
git clone "$UPSTREAM" "$CLONEDIR"
fi
if [ -d "$BASEDIR"/node_modules/browserify ]
then
echo "browserify already installed"
else (
echo "Installing browserify"
cd "$BASEDIR";
npm install --no-save browserify
) fi
echo "Transforming language-data"
"$BASEDIR"/node_modules/browserify/bin/cmd.js "$CLONEDIR"/data/language-data.json -t "$BASEDIR"/scripts/transform.js -o "$DEST"/jquery.uls.data.js
echo "language-data written to $DEST/jquery.uls.data.js"