Skip to content

Commit 6c73e5f

Browse files
authored
Create install.sh
1 parent 3fe22fe commit 6c73e5f

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

install.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
set -e
3+
4+
VERSION="${1:-v0.1.0}"
5+
OS="$(uname | tr '[:upper:]' '[:lower:]')"
6+
ARCH="$(uname -m)"
7+
8+
# Translate arch names
9+
if [[ "$ARCH" == "x86_64" ]]; then ARCH="amd64"; fi
10+
if [[ "$ARCH" == "arm64" || "$ARCH" == "aarch64" ]]; then ARCH="arm64"; fi
11+
12+
URL="https://github.com/dcode-tech/dcli/releases/download/$VERSION/dcli_${VERSION}_${OS}_${ARCH}.tar.gz"
13+
14+
echo "📦 Downloading dcli $VERSION for $OS/$ARCH..."
15+
mkdir -p ~/.dcode
16+
curl -sL "$URL" | tar -xz -C ~/.dcode
17+
18+
chmod +x ~/.dcode/dcli
19+
20+
echo "✅ Installed to ~/.dcode/dcli"
21+
echo "👉 Add to PATH: export PATH=\"\$HOME/.dcode:\$PATH\""

0 commit comments

Comments
 (0)