From d7cbd0a03de2e49ae1becca60bf5340e0841dd0e Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Wed, 8 Apr 2020 17:46:23 +0300 Subject: [PATCH] Fixes for fetch-language-data.sh (#360) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 https://github.com/wikimedia/language-data/commit/b485f5a1343ba6348faca8e4f4994fefe6c195e6 --- .gitignore | 1 + scripts/fetch-language-data.sh | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 4bd73dc..fb0d845 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,6 @@ /node_modules /dist data/supplementalData.xml +/scripts/vendor /vendor .eslintcache diff --git a/scripts/fetch-language-data.sh b/scripts/fetch-language-data.sh index f52cf53..ed610b6 100755 --- a/scripts/fetch-language-data.sh +++ b/scripts/fetch-language-data.sh @@ -2,8 +2,9 @@ set -o errexit -o nounset -o pipefail -BASEDIR=$(dirname "$(dirname "$(readlink -f "$0")")") -DEST="$BASEDIR/src/" +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" @@ -30,4 +31,4 @@ 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 wrote to $DEST/jquery.uls.data.js" +echo "language-data written to $DEST/jquery.uls.data.js"