-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·73 lines (63 loc) · 1.38 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·73 lines (63 loc) · 1.38 KB
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
#!/bin/sh
set -eu
repo="${AETHER_REPO:-Aculnaj/aethercli}"
version="${AETHER_VERSION:-latest}"
install_dir="${AETHER_INSTALL_DIR:-$HOME/.local/bin}"
need() {
if ! command -v "$1" >/dev/null 2>&1; then
echo "Missing required command: $1" >&2
exit 1
fi
}
need curl
need tar
need uname
need install
case "$(uname -s)" in
Darwin)
os="darwin"
;;
Linux)
os="linux"
;;
*)
echo "Unsupported operating system: $(uname -s)" >&2
exit 1
;;
esac
case "$(uname -m)" in
x86_64 | amd64)
arch="amd64"
;;
arm64 | aarch64)
arch="arm64"
;;
*)
echo "Unsupported CPU architecture: $(uname -m)" >&2
exit 1
;;
esac
asset="aether_${os}_${arch}.tar.gz"
if [ "$version" = "latest" ]; then
url="https://github.com/${repo}/releases/latest/download/${asset}"
else
url="https://github.com/${repo}/releases/download/${version}/${asset}"
fi
tmp_dir="$(mktemp -d)"
trap 'rm -rf "$tmp_dir"' EXIT INT TERM
echo "Downloading ${url}" >&2
curl -fsSL "$url" -o "$tmp_dir/$asset"
tar -xzf "$tmp_dir/$asset" -C "$tmp_dir"
mkdir -p "$install_dir"
install -m 755 "$tmp_dir/aether" "$install_dir/aether"
echo "" >&2
echo "Aether CLI installed successfully." >&2
echo "Binary: ${install_dir}/aether" >&2
case ":$PATH:" in
*":$install_dir:"*)
echo "Run: aether setup" >&2
;;
*)
echo "Add ${install_dir} to PATH, then run: aether setup" >&2
;;
esac