-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·63 lines (52 loc) · 1.4 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·63 lines (52 loc) · 1.4 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
#!/bin/sh
# install.sh — one-line install for fishez
# Usage: curl -sfL https://raw.githubusercontent.com/ioma8/fishez/main/install.sh | sh
set -eu
REPO="ioma8/fishez"
BIN="fishez"
VERSION="${1:-latest}"
# Detect OS and architecture
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
case "$OS" in
linux) ;;
darwin) OS="macos" ;;
*)
echo "Unsupported OS: $OS"
echo "Try: cargo install fishez"
echo "Then run: fishez --install-shell"
exit 1
;;
esac
case "$ARCH" in
x86_64) ARCH="x86_64" ;;
aarch64|arm64) ARCH="aarch64" ;;
*)
echo "Unsupported architecture: $ARCH"
echo "Try: cargo install fishez"
echo "Then run: fishez --install-shell"
exit 1
;;
esac
PLATFORM="$OS-$ARCH"
URL="https://github.com/$REPO/releases/$VERSION/download/fishez-$PLATFORM"
echo "Downloading fishez for $PLATFORM..."
if command -v curl >/dev/null 2>&1; then
curl -sfLo /tmp/fishez "$URL"
elif command -v wget >/dev/null 2>&1; then
wget -qO /tmp/fishez "$URL"
else
echo "Need curl or wget"
exit 1
fi
chmod +x /tmp/fishez
if [ "$(id -u)" -eq 0 ]; then
mv /tmp/fishez /usr/local/bin/$BIN
else
echo "Installing to /usr/local/bin (may ask for password)..."
sudo mv /tmp/fishez /usr/local/bin/$BIN
fi
/usr/local/bin/$BIN --install-shell || {
echo "To enable fz later, run: fishez --install-shell"
}
echo "✓ fishez installed. Run 'fishez' to start, or 'fz' to cd on exit."