Use wikimedia/language-data node module for data

Now that we have this node module, let us use that as upstream
for data
This commit is contained in:
Santhosh Thottingal
2017-08-21 19:00:10 +05:30
parent 71959b6a7c
commit 6d6a1326b5
8 changed files with 5500 additions and 7400 deletions

32
scripts/fetch-language-data.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
BASEDIR=$(dirname "$0")
BASEDIR="$BASEDIR/.."
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
pushd "$CLONEDIR"
git pull
popd
else
git clone "$UPSTREAM" "$CLONEDIR"
fi
if [ -d "$BASEDIR"/node_modules/browserify ];then
echo "browserify already installed"
else
echo "Installing browserify"
npm install browserify
fi
echo "Transforming language-data"
"$BASEDIR"/node_modules/browserify/bin/cmd.js "$CLONEDIR"/language-data.json -t "$BASEDIR"/scripts/transform.js -o "$DEST"/jquery.uls.data.js
echo "language-data wrote to $DEST/jquery.uls.data.js"
echo "Done."