File: download-unicode-files.sh

package info (click to toggle)
neovim 0.11.4-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 64,164 kB
  • sloc: ansic: 263,156; python: 1,472; lisp: 1,237; sh: 1,138; makefile: 382; xml: 83; ruby: 6
file content (36 lines) | stat: -rwxr-xr-x 1,018 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh

set -e
data_files="UnicodeData.txt CaseFolding.txt EastAsianWidth.txt"
emoji_files="emoji-data.txt"
files="'$data_files $emoji_files'"

UNIDIR_DEFAULT=src/unicode
DOWNLOAD_URL_BASE_DEFAULT='http://unicode.org/Public'

if test "$1" = '--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}."
  exit 0
fi

UNIDIR=${1:-$UNIDIR_DEFAULT}
DOWNLOAD_URL_BASE=${2:-$DOWNLOAD_URL_BASE_DEFAULT}

for filename in $data_files ; do
  curl -L -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/UNIDATA/$filename"
  git -C "$UNIDIR" add "$filename"
done

for filename in $emoji_files ; do
  curl -L -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/UNIDATA/emoji/$filename"
  git -C "$UNIDIR" add "$filename"
done

git -C "$UNIDIR" commit -m "feat: update unicode tables" .