-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathextra-binaries.sh
257 lines (188 loc) · 13.2 KB
/
extra-binaries.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
#!/usr/bin/env bash
GUM_LINK="https://github.com/charmbracelet/gum/releases/download/v0.14.5/gum_0.14.5_Linux_x86_64.tar.gz"
SCRIPT_PATH=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
GUM=$(command -v gum || printf "${SCRIPT_PATH}/gum")
if [ ! -x "${GUM}" ]; then
echo "gum is needed for this script, please wait."
wget "${GUM_LINK}" -O gum.tar.gz
tar xvzf gum.tar.gz --wildcards --no-anchored '*gum' && mv gum_*/gum . && rm -rf gum_*
fi
function section {
${GUM} style --width 60 \
--border rounded \
--align center \
--foreground 12 \
--border-foreground 12 \
"$1"
}
function question {
${GUM} confirm \
--prompt.foreground=6 \
--selected.background=6 \
"$1"
}
function text {
${GUM} style --width 60 \
--margin "1 0" \
"$1"
}
function info {
${GUM} style --width 60 \
--foreground 11 \
"$1"
}
section "Extra binaries"
question "Do you want to install extra binaries for your system?"
if [ $? = 0 ]; then
if [ ! -x "$(command -v jq)" ]; then
info "Installing jq."
sudo dnf install jq
fi
text "The script will get the latest versions of a list of binaries from the GitHub API. Please wait."
info "Getting latest version and downloading 'vivid'."
test -f vivid.json || wget -q -O vivid.json https://api.github.com/repos/sharkdp/vivid/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("linux-gnu")).browser_download_url' vivid.json)
info "Getting latest version and downloading 'gum'."
test -f gum.json || wget -q -O gum.json https://api.github.com/repos/charmbracelet/gum/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("Linux") and endswith("tar.gz")).browser_download_url' gum.json)
info "Getting latest version and downloading 'vhs'."
test -f vhs.json || wget -q -O vhs.json https://api.github.com/repos/charmbracelet/vhs/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("Linux") and endswith("tar.gz")).browser_download_url' vhs.json)
info "Getting latest version and downloading 'ttyd'."
test -f ttyd.json || wget -q -O ttyd.json https://api.github.com/repos/tsl0922/ttyd/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64")).browser_download_url' ttyd.json)
info "Getting latest version and downloading 'trivy'."
test -f trivy.json || wget -q -O trivy.json https://api.github.com/repos/aquasecurity/trivy/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("Linux") and contains("64bit") and endswith("tar.gz")).browser_download_url' trivy.json)
info "Getting latest version and downloading 'trippy'."
test -f trippy.json || wget -q -O trippy.json https://api.github.com/repos/fujiapple852/trippy/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("linux-gnu") and endswith("tar.gz")).browser_download_url' trippy.json)
info "Getting latest version and downloading 'trdsql'."
test -f trdsql.json || wget -q -O trdsql.json https://api.github.com/repos/noborus/trdsql/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("linux_amd64")).browser_download_url' trdsql.json)
info "Getting latest version and downloading 'yq'."
test -f yq.json || wget -q -O yq.json https://api.github.com/repos/mikefarah/yq/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("linux_amd64") and endswith("tar.gz")).browser_download_url' yq.json)
info "Getting latest version and downloading 'zellij'."
test -f zellij.json || wget -q -O zellij.json https://api.github.com/repos/zellij-org/zellij/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("linux") and endswith("tar.gz")).browser_download_url' zellij.json)
info "Getting latest version and downloading 'surreal'."
test -f surreal.json || wget -q -O surreal.json https://api.github.com/repos/surrealdb/surrealdb/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("amd64") and contains("linux") and endswith("tgz")).browser_download_url' surreal.json)
info "Getting latest version and downloading 'ripgrep'."
test -f ripgrep.json || wget -q -O ripgrep.json https://api.github.com/repos/BurntSushi/ripgrep/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("linux-musl") and endswith("tar.gz")).browser_download_url' ripgrep.json)
info "Getting latest version and downloading 'procs'."
test -f procs.json || wget -q -O procs.json https://api.github.com/repos/dalance/procs/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("linux") and endswith("zip")).browser_download_url' procs.json)
info "Getting latest version and downloading 'pingu'."
test -f pingu.json || wget -q -O pingu.json https://api.github.com/repos/sheepla/pingu/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("Linux") and endswith("tar.gz")).browser_download_url' pingu.json)
info "Getting latest version and downloading 'picocrypt'."
test -f picocrypt.json || wget -q -O picocrypt.json https://api.github.com/repos/Picocrypt/CLI/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("amd64") and contains("linux")).browser_download_url' picocrypt.json)
info "Getting latest version and downloading 'ouch'."
test -f ouch.json || wget -q -O ouch.json https://api.github.com/repos/ouch-org/ouch/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("linux-gnu")).browser_download_url' ouch.json)
info "Getting latest version and downloading 'lsd'."
test -f lsd.json || wget -q -O lsd.json https://api.github.com/repos/lsd-rs/lsd/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("linux-gnu")).browser_download_url' lsd.json)
info "Getting latest version and downloading 'lapce'."
test -f lapce.json || wget -q -O lapce.json https://api.github.com/repos/lapce/lapce/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("amd64") and contains("linux")).browser_download_url' lapce.json)
info "Getting latest version and downloading 'jless'."
test -f jless.json || wget -q -O jless.json https://api.github.com/repos/PaulJuliusMartinez/jless/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("linux")).browser_download_url' jless.json)
info "Getting latest version and downloading 'ipinfo'."
test -f ipinfo.json || wget -q -O ipinfo.json https://api.github.com/repos/ipinfo/cli/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("amd64") and contains("linux") and endswith("tar.gz")).browser_download_url' ipinfo.json)
info "Getting latest version and downloading 'hexyl'."
test -f hexyl.json || wget -q -O hexyl.json https://api.github.com/repos/sharkdp/hexyl/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("linux-gnu") and endswith("tar.gz")).browser_download_url' hexyl.json)
info "Getting latest version and downloading 'grex'."
test -f grex.json || wget -q -O grex.json https://api.github.com/repos/pemistahl/grex/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("linux") and endswith("tar.gz")).browser_download_url' grex.json)
info "Getting latest version and downloading 'gping'."
test -f gping.json || wget -q -O gping.json https://api.github.com/repos/orf/gping/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("Linux") and endswith("tar.gz")).browser_download_url' gping.json)
info "Getting latest version and downloading 'glow'."
test -f glow.json || wget -q -O glow.json https://api.github.com/repos/charmbracelet/glow/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("Linux") and endswith("tar.gz")).browser_download_url' glow.json)
info "Getting latest version and downloading 'fx'."
test -f fx.json || wget -q -O fx.json https://api.github.com/repos/antonmedv/fx/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("amd64") and contains("linux")).browser_download_url' fx.json)
info "Getting latest version and downloading 'freeze'."
test -f freeze.json || wget -q -O freeze.json https://api.github.com/repos/charmbracelet/freeze/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("Linux") and endswith("tar.gz")).browser_download_url' freeze.json)
info "Getting latest version and downloading 'fd'."
test -f fd.json || wget -q -O fd.json https://api.github.com/repos/sharkdp/fd/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("linux-gnu") and endswith("tar.gz")).browser_download_url' fd.json)
info "Getting latest version and downloading 'f2'."
test -f f2.json || wget -q -O f2.json https://api.github.com/repos/ayoisaiah/f2/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("amd64") and contains("linux") and endswith("tar.gz")).browser_download_url' f2.json)
info "Getting latest version and downloading 'duf'."
test -f duf.json || wget -q -O duf.json https://api.github.com/repos/muesli/duf/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("linux") and endswith("tar.gz")).browser_download_url' duf.json)
info "Getting latest version and downloading 'duckdb'."
test -f duckdb.json || wget -q -O duckdb.json https://api.github.com/repos/duckdb/duckdb/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("amd64") and contains("linux") and contains("cli")).browser_download_url' duckdb.json)
info "Getting latest version and downloading 'deno'."
test -f deno.json || wget -q -O deno.json https://api.github.com/repos/denoland/deno/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("linux-gnu") and contains("deno-") and endswith("zip")).browser_download_url' deno.json)
info "Getting latest version and downloading 'bun'."
test -f bun.json || wget -q -O bun.json https://api.github.com/repos/oven-sh/bun/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("linux") and endswith("x64.zip")).browser_download_url' bun.json)
info "Getting latest version and downloading 'bottom'."
test -f bottom.json || wget -q -O bottom.json https://api.github.com/repos/ClementTsang/bottom/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("linux") and endswith("gnu.tar.gz")).browser_download_url' bottom.json)
info "Getting latest version and downloading 'binsider'."
test -f binsider.json || wget -q -O binsider.json https://api.github.com/repos/orhun/binsider/releases/latest
wget -q $(jq -r '.assets[] | select(.name | contains("x86_64") and contains("linux-gnu") and endswith("tar.gz")).browser_download_url' binsider.json)
text "Preparing to unpack binaries."
info "Creating temporary directory."
rm -f archives
mkdir -p archives
info "Moving files to temporary directory."
find . -mindepth 1 -maxdepth 1 '(' -name "*.zip" -o -name "*.tar.gz" -o -name "*.tgz" ')' -exec mv {} archives/ \;
info "Unpacking binaries."
(cd archives && find -type f -name "*.tar.gz" -exec tar xzf {} \;)
(cd archives && find -type f -name "*.tgz" -exec tar xzf {} \;)
(cd archives && find -type f -name "*.zip" -exec unzip -q -n {} \;)
info "Creating deployment directory."
rm -f deploys
mkdir -p deploys
info "Moving binaries to the deployment directory."
find archives -type f -executable -exec mv {} deploys/ \;
info "Getting latest version and downloading 'vimv'."
wget -q -O vimv https://raw.githubusercontent.com/thameera/vimv/master/vimv
info "Making 'vimv' executable."
chmod +x vimv
info "Moving 'vimv' to the deployment directory."
mv vimv deploys/
info "Fixing 'yq' and moving to the deployment directory."
mv deploys/yq_* deploys/yq
info "Making 'yq' executable."
chmod +x deploys/yq
info "Fixing 'ipinfo' and moving to the deployment directory."
mv deploys/ipinfo_* deploys/ipinfo
info "Making 'ipinfo' executable."
chmod +x deploys/ipinfo
info "Fixing 'fx' and moving to the deployment directory."
mv fx_* deploys/fx
info "Making 'fx' executable."
chmod +x deploys/fx
info "Fixing 'picocrypt' and moving to the deployment directory."
mv picocrypt-* deploys/picocrypt
info "Making 'picocrypt' executable."
chmod +x deploys/picocrypt
info "Fixing 'ttyd' and moving to the deployment directory."
mv ttyd.x* deploys/ttyd
info "Making 'ttyd' executable."
chmod +x deploys/ttyd
info "Removing unused files from the deployment directory."
rm -f deploys/*.sh
info "Moving binaries to the home directory."
mkdir -p "${HOME}/.local/bin"
(cd deploys && mv * "${HOME}/.local/bin/")
fi
text "That's all, folks!"