-
-
Notifications
You must be signed in to change notification settings - Fork 105
Expand file tree
/
Copy pathinstall.sh
More file actions
44 lines (37 loc) · 681 Bytes
/
Copy pathinstall.sh
File metadata and controls
44 lines (37 loc) · 681 Bytes
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
#!/bin/sh
owner='antonmedv'
name='walk'
version='v1.13.0'
os=$(uname -s | tr '[:upper:]' '[:lower:]')
machine=$(uname -m)
case $os in
linux | darwin)
ext=''
;;
windows)
os=windows
ext='.exe'
;;
*)
echo "Unsupported OS: $os" >&2
exit 1
;;
esac
case $machine in
x86_64 | amd64)
arch=amd64
;;
arm64 | aarch64)
arch=arm64
;;
*)
echo "Unsupported architecture: $machine" >&2
exit 1
;;
esac
asset="${name}_${os}_${arch}${ext}"
echo "Downloading ${asset} (${version})"
curl -Lf --progress-bar "https://github.com/${owner}/${name}/releases/download/${version}/${asset}" -o "${name}"
chmod +x "${name}"
set -x
sudo mv "${name}" "/usr/local/bin/${name}"