Mercurial > ec-dotfiles
comparison update-vendor @ 718:1f8218896f2a
[update-vendor] Fix indents and remove useless touch
| author | nanaya <me@nanaya.net> | 
|---|---|
| date | Mon, 19 Dec 2022 05:46:25 +0900 | 
| parents | 42e58cea7821 | 
| children | 0a896ffe3029 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 717:11cbbaf42768 | 718:1f8218896f2a | 
|---|---|
| 1 #!/bin/sh | 1 #!/bin/sh | 
| 2 | 2 | 
| 3 set -u | 3 set -u | 
| 4 set -e | 4 set -e | 
| 5 | 5 | 
| 6 | |
| 7 for _cmd in wget unzip; do | 6 for _cmd in wget unzip; do | 
| 8 if command -v "$_cmd" > /dev/null 2>&1; then : | 7 if command -v "$_cmd" > /dev/null 2>&1; then : | 
| 9 else | 8 else | 
| 10 echo "${_cmd} is required" | 9 echo "${_cmd} is required" | 
| 11 exit 1 | 10 exit 1 | 
| 12 fi | 11 fi | 
| 13 done | 12 done | 
| 14 | 13 | 
| 15 _get() { | 14 _get() { | 
| 16 ( | 15 ( | 
| 17 if [ -n "${2:-}" ]; then | 16 if [ -n "${2:-}" ]; then | 
| 18 mkdir -p "$2" && cd "$2" | 17 mkdir -p "$2" && cd "$2" | 
| 19 fi | 18 fi | 
| 20 wget -nv "$1" | 19 wget -nv "$1" | 
| 21 ) | 20 ) | 
| 22 } | 21 } | 
| 23 | 22 | 
| 24 _get_pack_github() { | 23 _get_pack_github() { | 
| 25 ( | 24 ( | 
| 26 wget -nv -O - "https://github.com/${1}/${2}/archive/refs/heads/${3}.zip" | unzip -q - | 25 wget -nv -O - "https://github.com/${1}/${2}/archive/refs/heads/${3}.zip" | unzip -q - | 
| 27 mv "./${2}-${3}" "./${2}" | 26 mv "./${2}-${3}" "./${2}" | 
| 28 ) | 27 ) | 
| 29 } | 28 } | 
| 30 | 29 | 
| 31 _syntaxes() { | 30 _syntaxes() { | 
| 32 ( | 31 ( | 
| 33 cd "$(dirname "$0")/vendor/vim-syntax" | 32 cd "$(dirname "$0")/vendor/vim-syntax" | 
| 34 | 33 | 
| 35 rm -f ./*.vim ./*/*.vim | 34 rm -f ./*.vim ./*/*.vim | 
| 36 _get https://hg.nginx.org/nginx/raw-file/tip/contrib/vim/syntax/nginx.vim | 35 _get https://hg.nginx.org/nginx/raw-file/tip/contrib/vim/syntax/nginx.vim | 
| 37 _get https://raw.githubusercontent.com/jwalton512/vim-blade/master/syntax/blade.vim | 36 _get https://raw.githubusercontent.com/jwalton512/vim-blade/master/syntax/blade.vim | 
| 38 _get https://raw.githubusercontent.com/kchmck/vim-coffee-script/master/syntax/coffee.vim | 37 _get https://raw.githubusercontent.com/kchmck/vim-coffee-script/master/syntax/coffee.vim | 
| 39 _get https://raw.githubusercontent.com/slim-template/vim-slim/master/syntax/slim.vim | 38 _get https://raw.githubusercontent.com/slim-template/vim-slim/master/syntax/slim.vim | 
| 40 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/css.vim | 39 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/css.vim | 
| 41 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/eruby.vim | 40 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/eruby.vim | 
| 42 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/javascript.vim | 41 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/javascript.vim | 
| 43 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/json.vim | 42 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/json.vim | 
| 44 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/less.vim | 43 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/less.vim | 
| 45 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/ruby.vim | 44 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/ruby.vim | 
| 46 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/scss.vim | 45 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/scss.vim | 
| 47 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/typescript.vim | 46 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/typescript.vim | 
| 48 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/shared/typescriptcommon.vim shared | 47 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/shared/typescriptcommon.vim shared | 
| 49 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/typescriptreact.vim | 48 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/typescriptreact.vim | 
| 50 ) | 49 ) | 
| 51 } | 50 } | 
| 52 | 51 | 
| 53 _packs() { | 52 _packs() { | 
| 54 ( | 53 ( | 
| 55 cd "$(dirname "$0")/vendor/vim-packs" | 54 cd "$(dirname "$0")/vendor/vim-packs" | 
| 56 | 55 | 
| 57 touch empty | 56 rm -rf ./* | 
| 58 rm -rf ./* | 57 _get_pack_github "srcery-colors" "srcery-vim" "master" | 
| 59 _get_pack_github "srcery-colors" "srcery-vim" "master" | 58 _get_pack_github "ctrlpvim" "ctrlp.vim" "master" | 
| 60 _get_pack_github "ctrlpvim" "ctrlp.vim" "master" | |
| 61 ) | 59 ) | 
| 62 } | 60 } | 
| 63 | 61 | 
| 64 _syntaxes | 62 _syntaxes | 
| 65 _packs | 63 _packs | 
