Repository navigation
Expand file tree
/
Copy pathinstall.sh
More file actions
59 lines (50 loc) · 1.92 KB
/
Copy pathinstall.sh
File metadata and controls
59 lines (50 loc) · 1.92 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
#!/usr/bin/env bash
# ==============================================================================
# EIDCloud Master CLI Installer for Linux & macOS (Bash)
# Author: Eng. MHD. Shadi AL-Hasan <mhd.shadi.alhasan@gmail.com>
# ==============================================================================
set -e
INSTALL_DIR="$HOME/.eidcloud"
REPO_URL="https://github.com/shadialhasan/eidcloud-cli.git"
BIN_DIR="$INSTALL_DIR/bin"
echo ""
echo "========================================================"
echo " ☁️ Installing EIDCloud Master CLI & Ecosystem Tools"
echo " Author: Eng. MHD. Shadi AL-Hasan <mhd.shadi.alhasan@gmail.com>"
echo "========================================================"
echo ""
# 1. Verify PHP installation
if ! command -v php >/dev/null 2>&1; then
echo "Error: PHP 8.2+ is required but not installed." >&2
echo "Please install PHP via 'apt install php-cli' or 'brew install php'." >&2
exit 1
fi
# 2. Clone or Update
if [ -d "$INSTALL_DIR/.git" ]; then
echo "[*] Updating existing installation..."
cd "$INSTALL_DIR"
git pull origin main
git submodule update --init --recursive
else
echo "[*] Cloning EIDCloud Master CLI and submodules..."
rm -rf "$INSTALL_DIR"
git clone --recurse-submodules "$REPO_URL" "$INSTALL_DIR"
fi
chmod +x "$BIN_DIR/eidcloud"
# 3. Add to PATH in ~/.bashrc or ~/.zshrc
SHELL_RC="$HOME/.bashrc"
if [ -n "$ZSH_VERSION" ] || [ -f "$HOME/.zshrc" ]; then
SHELL_RC="$HOME/.zshrc"
fi
if ! grep -q "$BIN_DIR" "$SHELL_RC" 2>/dev/null; then
echo "" >> "$SHELL_RC"
echo "# EIDCloud Master CLI" >> "$SHELL_RC"
echo "export PATH=\"\$PATH:$BIN_DIR\"" >> "$SHELL_RC"
echo "[*] Added $BIN_DIR to $SHELL_RC"
fi
echo ""
echo "[✓] EIDCloud Master CLI successfully installed!"
echo " Restart your shell or run: source $SHELL_RC"
echo " Run 'eidcloud doctor' to verify ecosystem health."
echo " Run 'eidcloud list' to browse all 49+ tools."
echo ""