Mercurial > ec-dotfiles
comparison update-vendor @ 704:1e0f578f6752
Update vendor and add support for vim packs
author | nanaya <me@nanaya.net> |
---|---|
date | Sun, 18 Dec 2022 20:06:46 +0900 |
parents | 17cacf387f7c |
children | 4b30df382167 |
comparison
equal
deleted
inserted
replaced
703:b7cd7465cc26 | 704:1e0f578f6752 |
---|---|
2 | 2 |
3 set -u | 3 set -u |
4 set -e | 4 set -e |
5 | 5 |
6 | 6 |
7 if command -v wget > /dev/null 2>&1; then : | 7 for _cmd in wget unzip; do |
8 else | 8 if command -v "$_cmd" > /dev/null 2>&1; then : |
9 echo wget is required | 9 else |
10 exit 1 | 10 echo "${_cmd} is required" |
11 fi | 11 exit 1 |
12 | 12 fi |
13 done | |
13 | 14 |
14 _get() { | 15 _get() { |
15 ( | 16 ( |
16 if [ -n "${2:-}" ]; then | 17 if [ -n "${2:-}" ]; then |
17 mkdir -p "$2" && cd "$2" | 18 mkdir -p "$2" && cd "$2" |
18 fi | 19 fi |
19 wget -nv "$1" | 20 wget -nv "$1" |
20 ) | 21 ) |
21 } | 22 } |
22 | 23 |
24 _get_pack_github() { | |
25 ( | |
26 mkdir -p "$1" && cd "$1" | |
27 wget -nv -O - "$2" | unzip -q - | |
28 # hopefully only one directory inside | |
29 _dirname="$(echo *)" | |
30 mv "./${_dirname}"/* ./ | |
31 mv "./${_dirname}"/.??* ./ | |
32 rmdir "./${_dirname}" | |
33 ) | |
34 } | |
23 | 35 |
36 _autoloads() { | |
24 ( | 37 ( |
25 cd "$(dirname "$0")/vendor/vim-autoload" | 38 cd "$(dirname "$0")/vendor/vim-autoload" |
26 | 39 |
27 rm -f ./*.vim ./*/*.vim | 40 rm -f ./*.vim ./*/*.vim |
28 _get "https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim" | 41 _get "https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim" |
29 ) | 42 ) |
43 } | |
30 | 44 |
31 | 45 _syntaxes() { |
32 ( | 46 ( |
33 cd "$(dirname "$0")/vendor/vim-syntax" | 47 cd "$(dirname "$0")/vendor/vim-syntax" |
34 | 48 |
35 rm -f ./*.vim ./*/*.vim | 49 rm -f ./*.vim ./*/*.vim |
36 _get https://hg.nginx.org/nginx/raw-file/tip/contrib/vim/syntax/nginx.vim | 50 _get https://hg.nginx.org/nginx/raw-file/tip/contrib/vim/syntax/nginx.vim |
46 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/scss.vim | 60 _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 | 61 _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 | 62 _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 | 63 _get https://raw.githubusercontent.com/vim/vim/master/runtime/syntax/typescriptreact.vim |
50 ) | 64 ) |
65 } | |
51 | 66 |
67 _colors() { | |
52 ( | 68 ( |
53 cd "$(dirname "$0")/vendor/vim-colors" | 69 cd "$(dirname "$0")/vendor/vim-colors" |
54 | 70 |
55 rm -f ./*.vim ./*/*.vim | 71 rm -f ./*.vim ./*/*.vim |
56 _get https://raw.githubusercontent.com/NLKNguyen/papercolor-theme/master/colors/PaperColor.vim | 72 _get https://raw.githubusercontent.com/NLKNguyen/papercolor-theme/master/colors/PaperColor.vim |
57 _get https://raw.githubusercontent.com/srcery-colors/srcery-vim/master/colors/srcery.vim | |
58 _get https://raw.githubusercontent.com/tomasiser/vim-code-dark/master/colors/codedark.vim | 73 _get https://raw.githubusercontent.com/tomasiser/vim-code-dark/master/colors/codedark.vim |
59 ) | 74 ) |
75 } | |
76 | |
77 _packs() { | |
78 ( | |
79 cd "$(dirname "$0")/vendor/vim-packs" | |
80 | |
81 touch empty | |
82 rm -rf ./* | |
83 _get_pack_github "srcery-vim" "https://github.com/srcery-colors/srcery-vim/archive/refs/heads/master.zip" | |
84 ) | |
85 } | |
86 | |
87 _autoloads | |
88 _syntaxes | |
89 _colors | |
90 _packs |