aboutsummaryrefslogtreecommitdiff
path: root/scripts/download-unicode-files.sh
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2015-08-19 23:41:12 -0400
committerJustin M. Keyes <justinkz@gmail.com>2015-08-19 23:41:12 -0400
commit2647677618118a1d9c34f7210c149ce9bc6e3d2a (patch)
treef2b9cf2580346ae961591a040d93062878f2b7cc /scripts/download-unicode-files.sh
parent60e62824b86e284dec477568e6523d78861787ae (diff)
parent4d2807e128b6a934828f0dc44d309e2234f50bce (diff)
downloadrneovim-2647677618118a1d9c34f7210c149ce9bc6e3d2a.tar.gz
rneovim-2647677618118a1d9c34f7210c149ce9bc6e3d2a.tar.bz2
rneovim-2647677618118a1d9c34f7210c149ce9bc6e3d2a.zip
Merge pull request #2159 from ZyX-I/auto-unicode
Generate unicode tables with script
Diffstat (limited to 'scripts/download-unicode-files.sh')
-rwxr-xr-xscripts/download-unicode-files.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/download-unicode-files.sh b/scripts/download-unicode-files.sh
new file mode 100755
index 0000000000..cb15270cf8
--- /dev/null
+++ b/scripts/download-unicode-files.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+set -e
+
+files="UnicodeData.txt CaseFolding.txt EastAsianWidth.txt"
+
+UNIDIR_DEFAULT=unicode
+DOWNLOAD_URL_BASE_DEFAULT='http://unicode.org/Public/UNIDATA'
+
+if test x$1 = 'x--help' ; then
+ echo 'Usage:'
+ echo " $0[ TARGET_DIRECTORY[ URL_BASE]]"
+ echo
+ echo "Downloads files $files to TARGET_DIRECTORY."
+ echo "Each file is downloaded from URL_BASE/\$filename."
+ echo
+ echo "Default target directory is $PWD/${UNIDIR_DEFAULT}."
+ echo "Default URL base is ${DOWNLOAD_URL_BASE_DEFAULT}."
+fi
+
+UNIDIR=${1:-$UNIDIR_DEFAULT}
+DOWNLOAD_URL_BASE=${2:-$DOWNLOAD_URL_BASE_DEFAULT}
+
+for filename in $files ; do
+ curl -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/$filename"
+ (
+ cd "$UNIDIR"
+ git add $filename
+ )
+done
+
+(
+ cd "$UNIDIR"
+ git commit -m "Update unicode files" -- $files
+)