diff options
author | ZyX <kp-pav@yandex.ru> | 2015-03-15 21:28:38 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2015-07-26 22:59:46 +0300 |
commit | 8f9b81059a7dbc1c0646f5d6bc7b58f01b2f70e1 (patch) | |
tree | 375b3470f6b6852d46131045aa216f2ff6b9cd20 /scripts | |
parent | c31b3339ffb83c59a10c92c6ece6e54cf7036ed6 (diff) | |
download | rneovim-8f9b81059a7dbc1c0646f5d6bc7b58f01b2f70e1.tar.gz rneovim-8f9b81059a7dbc1c0646f5d6bc7b58f01b2f70e1.tar.bz2 rneovim-8f9b81059a7dbc1c0646f5d6bc7b58f01b2f70e1.zip |
Create script that downloads and commits UNIDATA files
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/download-unicode-files.sh | 35 |
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 +) |