-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_tools.sh
executable file
·113 lines (91 loc) · 4.54 KB
/
update_tools.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/usr/bin/env bash
LOCAL_BIN_PATH="${LOCAL_BIN_PATH:-$HOME/local/bin}"
export GIT_WGET_TMP_DIR=${GIT_WGET_TMP_DIR:-~/.config/git-wget/}
if ! type git-wget >/dev/null 2>&1; then
echo "Please install 'https://github.com/umaumax/git-wget'"
cat <<'EOF'
install_path="$HOME/local/bin/git-wget"
wget https://raw.githubusercontent.com/umaumax/git-wget/master/git-wget -O "$install_path"
chmod u+x "$install_path"
EOF
exit 1
fi
BLACK=$'\e[30m' RED=$'\e[31m' GREEN=$'\e[32m' YELLOW=$'\e[33m' BLUE=$'\e[34m' PURPLE=$'\e[35m' LIGHT_BLUE=$'\e[36m' WHITE=$'\e[37m' GRAY=$'\e[90m' DEFAULT=$'\e[0m'
function echo_log() {
echo "${GREEN}$*${DEFAULT}" 1>&2
}
target=${1:-''}
function download() {
local url="$1"
if [[ -n "$target" ]] && [[ "$(basename "$url")" != "$target" ]]; then
echo_log "${YELLOW}[LOG] skip download $url"
return
fi
echo_log "${BLUE}[LOG] download $url"
git wget "$@"
}
echo_log "[LOG] init setup"
mkdir -p "$LOCAL_BIN_PATH"
cd "$LOCAL_BIN_PATH"
set -e
zsh_completion_dirpath="$HOME/local/share/zsh/site-functions/"
mkdir -p "$zsh_completion_dirpath"
# ====
echo_log "[LOG] start download"
if [[ ! -e git-clang-format ]]; then
wget https://raw.githubusercontent.com/llvm/llvm-project/main/clang/tools/clang-format/git-clang-format
chmod u+x git-clang-format
fi
download https://github.com/umaumax/oressh/blob/master/oressh
download https://github.com/umaumax/diff-filter/blob/master/diff-filter
download https://github.com/umaumax/git-sed/blob/master/git-sed
download https://github.com/umaumax/git-sed/blob/master/git-fixedsed
download https://github.com/umaumax/git-shadow/blob/master/git-shadow
download https://github.com/umaumax/git-shadow/blob/master/_git_shadow -O "$zsh_completion_dirpath/"
download https://github.com/umaumax/git-at/blob/master/git-at
download https://github.com/umaumax/git-at/blob/master/_git_at -O "$zsh_completion_dirpath/"
download https://github.com/umaumax/git-url/blob/master/git-url
download https://github.com/umaumax/imv/blob/master/imv
download https://github.com/umaumax/clip-share/blob/master/clip-share
download https://github.com/umaumax/wcat/blob/master/wcat
download https://github.com/umaumax/comment_asm/blob/master/comment_asm
download https://github.com/umaumax/lessbat/blob/master/lessbat
download https://github.com/umaumax/findtar/blob/master/findtar
download https://github.com/umaumax/awkst/blob/master/awkst
download https://github.com/umaumax/oresed/blob/master/oresed
download https://github.com/umaumax/sedry/blob/master/sedry
download https://github.com/umaumax/sshpass_wrapper/blob/master/autosshpass
download https://github.com/umaumax/sshpass_wrapper/blob/master/autoscppass
download https://github.com/umaumax/sshpass_wrapper/blob/master/autorsyncpass
ln -sf autosshpass autooresshpass
download https://github.com/umaumax/bash_onerror/blob/master/bash_onerror
download https://github.com/umaumax/yaml-sort/blob/master/_yaml-sort -O "$zsh_completion_dirpath/"
download https://github.com/umaumax/dotorphan/blob/master/_dotorphan -O "$zsh_completion_dirpath/"
download https://github.com/takaaki-kasai/git-foresta/blob/master/git-foresta
download https://github.com/paulirish/git-recent/blob/master/git-recent
download https://github.com/stedolan/git-ls/blob/master/git-ls
download https://github.com/dmnd/git-diff-blame/blob/master/git-diff-blame
download https://github.com/nornagon/git-rebase-all/blob/master/git-rebase-all
download https://github.com/unixorn/git-extra-commands/blob/main/bin/git-pylint
download https://github.com/unixorn/git-extra-commands/blob/main/bin/git-rename-branches
download https://github.com/tj/git-extras/blob/master/bin/git-touch
download https://github.com/so-fancy/diff-so-fancy/blob/master//diff-so-fancy
download https://github.com/jantman/misc-scripts/blob/master/dot_find_cycles.py
# NOTE: for wrap script by python3
cat >dot_find_cycles <<'EOF'
#!/usr/bin/env bash
python3 "$(dirname $0)/dot_find_cycles.py" $@
EOF
chmod u+x dot_find_cycles
if [[ "$(uname -a)" =~ Ubuntu ]]; then
download https://github.com/umaumax/window-toggle/blob/master/window-toggle
download https://github.com/umaumax/window-toggle/blob/master/wintoggle
fi
if [[ $(uname) == "Darwin" ]]; then
download https://github.com/Rasukarusan/fzf-chrome-active-tab/blob/master/chrome-tab-activate
download https://github.com/umaumax/fzf-chrome-history/blob/master/chromeHistory.sh -O chromeHistory
fi
download https://github.com/umaumax/git-wget/blob/master/_git_wget -O "$zsh_completion_dirpath/"
# ----
echo_log "[LOG] update download command itself"
download https://github.com/umaumax/git-wget/blob/master/git-wget