-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·62 lines (52 loc) · 2.6 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·62 lines (52 loc) · 2.6 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
#!/usr/bin/env bash
# One-line installer for dj.
#
# Usage:
# curl -fsSL https://raw.githubusercontent.com/baymac/dj/main/install.sh | bash
#
# Installs the latest GitHub Release via uv tool install.
# Requirements: macOS, uv (https://astral.sh/uv/install.sh).
set -euo pipefail
REPO="baymac/dj"
INSTALL_URL="git+https://github.com/${REPO}.git"
# ── OS check ────────────────────────────────────────────────────────────────
if [[ "$(uname)" != "Darwin" ]]; then
echo "dj requires macOS." >&2
exit 1
fi
# ── uv check ────────────────────────────────────────────────────────────────
if ! command -v uv &>/dev/null; then
echo "uv is required but not found."
echo "Install it first: curl -LsSf https://astral.sh/uv/install.sh | sh"
exit 1
fi
# ── Resolve latest release tag ──────────────────────────────────────────────
echo "Fetching latest release tag from github.com/${REPO}…"
LATEST=$(curl -fsSL \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${REPO}/releases/latest" \
| python3 -c "import sys,json; print(json.load(sys.stdin)['tag_name'])" 2>/dev/null || true)
if [[ -z "$LATEST" ]]; then
echo "Could not determine the latest release tag."
echo "Check your network or install a specific version:"
echo " uv tool install ${INSTALL_URL}@<tag>"
exit 1
fi
echo "Installing dj ${LATEST}…"
# ── Check for stale dj-tools dist and warn ──────────────────────────────────
if uv tool list 2>/dev/null | grep -q "^dj-tools"; then
echo ""
echo "WARNING: old 'dj-tools' tool is installed."
echo " Remove it to avoid PATH conflicts: uv tool uninstall dj-tools"
echo ""
fi
# ── Install ─────────────────────────────────────────────────────────────────
uv tool install --force "${INSTALL_URL}@${LATEST}"
echo ""
echo "dj ${LATEST} installed successfully."
echo ""
echo "Next steps:"
echo " 1. Create ~/Music/dj/.env with your Beatport session token:"
echo " echo 'BEATPORT_SESSION_TOKEN=<token>' >> ~/Music/dj/.env"
echo " 2. Run 'dj doctor' to verify all prerequisites."
echo " 3. Run 'dj --help' to see available commands."