-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·37 lines (27 loc) · 810 Bytes
/
Copy pathinstall.sh
File metadata and controls
executable file
·37 lines (27 loc) · 810 Bytes
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
#!/usr/bin/env bash
set -euo pipefail
REPO="lramos0/docsme"
DEFAULT_BRANCH="main"
INSTALL_PATH="/usr/local/bin/docsme"
# Allow optional version argument (tag like v1.0.0)
VERSION="${1:-$DEFAULT_BRANCH}"
if [[ "$VERSION" == "$DEFAULT_BRANCH" ]]; then
URL="https://raw.githubusercontent.com/$REPO/$DEFAULT_BRANCH/bin/docsme"
else
URL="https://raw.githubusercontent.com/$REPO/$VERSION/bin/docsme"
fi
echo "Installing docsme from $VERSION..."
# Create temp file
TMP_FILE="$(mktemp)"
# Download script
curl -fsSL "$URL" -o "$TMP_FILE"
# Ensure it's executable
chmod +x "$TMP_FILE"
# Move to global path
if [[ -w "$(dirname "$INSTALL_PATH")" ]]; then
mv "$TMP_FILE" "$INSTALL_PATH"
else
sudo mv "$TMP_FILE" "$INSTALL_PATH"
fi
echo "✅ Installed docsme → $INSTALL_PATH"
echo "Run: docsme --help"