-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·80 lines (63 loc) · 1.59 KB
/
install.sh
File metadata and controls
executable file
·80 lines (63 loc) · 1.59 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
74
75
76
77
78
79
80
#!/usr/bin/env bash
set -e
REPO="https://github.com/exilonium/music-cli"
INSTALL_DIR="$HOME/.local/bin"
TMP_DIR="$(mktemp -d)"
echo "🎵 Installing music-cli..."
# Detect OS
OS="$(uname -s)"
install_deps_linux() {
if command -v apt >/dev/null; then
sudo apt update
sudo apt install -y curl jq fzf yt-dlp aria2 mpv
elif command -v pacman >/dev/null; then
sudo pacman -Sy --noconfirm curl jq fzf yt-dlp aria2 mpv
elif command -v dnf >/dev/null; then
sudo dnf install -y curl jq fzf yt-dlp aria2 mpv
else
echo "⚠️ Unsupported package manager. Install dependencies manually:"
echo "curl jq fzf/rofi yt-dlp aria2 mpv"
fi
}
install_deps_macos() {
if ! command -v brew >/dev/null; then
echo "❌ Homebrew not found. Install it first: https://brew.sh/"
exit 1
fi
brew install curl jq fzf yt-dlp aria2 mpv
}
echo "📦 Installing dependencies..."
case "$OS" in
Linux)
install_deps_linux
;;
Darwin)
install_deps_macos
;;
*)
echo "❌ Unsupported OS: $OS"
exit 1
;;
esac
# Clone repo
echo "⬇️ Downloading music-cli..."
git clone --depth=1 "$REPO" "$TMP_DIR/music-cli"
cd "$TMP_DIR/music-cli"
# Make executable
chmod +x music-cli
# Install binary
mkdir -p "$INSTALL_DIR"
cp music-cli "$INSTALL_DIR/music-cli"
# Cleanup
rm -rf "$TMP_DIR"
echo "✅ Installed to $INSTALL_DIR/music-cli"
# PATH check
if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then
echo ""
echo "⚠️ $INSTALL_DIR is not in your PATH"
echo "Add this to your shell config:"
echo "export PATH=\"\$HOME/.local/bin:\$PATH\""
fi
echo ""
echo "🚀 Done! Try:"
echo "music-cli dandelions"