feat: create install.sh with basic install functionality
Swadhin Biswas committed 7 months ago
193d13b
1 parent b5a60b1
commit 193d13b
1 file changed
+50 -0
Showing 1 changed file+50-0
▼install.sh
+50-0
| @@ -0,0 +1,50 @@ | ||
1 | +#!/usr/bin/env bash | |
2 | +# ============================================================================ | |
3 | +# FetchX Installer Script | |
4 | +# A fast, feature-rich system information tool written in Rust | |
5 | +# | |
6 | +# Usage: | |
7 | +# curl -fsSL https://raw.githubusercontent.com/swadhinbiswas/fetchx/main/install.sh | bash | |
8 | +# or | |
9 | +# wget -qO- https://raw.githubusercontent.com/swadhinbiswas/fetchx/main/install.sh | bash | |
10 | +# or | |
11 | +# ./install.sh | |
12 | +# | |
13 | +# Options: | |
14 | +# --prefix=/usr/local Installation prefix (default: ~/.local) | |
15 | +# --system Install system-wide to /usr/local/bin (requires sudo) | |
16 | +# --uninstall Remove FetchX | |
17 | +# --no-alias Skip shell alias setup | |
18 | +# --help Show help | |
19 | +# ============================================================================ | |
20 | + | |
21 | +set -euo pipefail | |
22 | + | |
23 | +# ── Colors ──────────────────────────────────────────────────────────────────── | |
24 | +RED='\033[0;31m' | |
25 | +GREEN='\033[0;32m' | |
26 | +YELLOW='\033[1;33m' | |
27 | +BLUE='\033[0;34m' | |
28 | +CYAN='\033[0;36m' | |
29 | +BOLD='\033[1m' | |
30 | +RESET='\033[0m' | |
31 | + | |
32 | +# ── Defaults ────────────────────────────────────────────────────────────────── | |
33 | +PREFIX="$HOME/.local" | |
34 | +SYSTEM_INSTALL=false | |
35 | +UNINSTALL=false | |
36 | +SETUP_ALIAS=true | |
37 | +REPO_URL="https://github.com/swadhinbiswas/fetchx.git" | |
38 | +BINARY_NAME="fetchx" | |
39 | + | |
40 | +# ── Parse arguments ────────────────────────────────────────────────────────── | |
41 | +for arg in "$@"; do | |
42 | + case "$arg" in | |
43 | + --prefix=*) PREFIX="${arg#*=}" ;; | |
44 | + --system) SYSTEM_INSTALL=true; PREFIX="/usr/local" ;; | |
45 | + --uninstall) UNINSTALL=true ;; | |
46 | + --no-alias) SETUP_ALIAS=false ;; | |
47 | + --help|-h) | |
48 | + echo "FetchX Installer" | |
49 | + echo "" | |
50 | + echo "Usage: ./install.sh [OPTIONS]" | |
0 | 51 | |