-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·50 lines (37 loc) · 1.33 KB
/
install.sh
File metadata and controls
executable file
·50 lines (37 loc) · 1.33 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
#!/usr/bin/env bash
# Exit on any error
set -e
# --- Configuration ---
GITHUB_ORG="TheBuildBox"
REPO_NAME="buildbox"
REPO_BRANCH="main"
BINARY_NAME="builbo"
BINARY_REPO_DIR="cli"
SOURCE_URL="https://raw.githubusercontent.com/${GITHUB_ORG}/${REPO_NAME}/${REPO_BRANCH}/${BINARY_REPO_DIR}/${BINARY_NAME}"
INSTALL_PREFIX="/usr/local"
INSTALL_BIN_DIR="${INSTALL_PREFIX}/bin"
INSTALL_PATH="/${INSTALL_BIN_DIR}/${BINARY_NAME}"
# Colors for terminal output
BLUE='\033[0;34m'
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e "${BLUE}==>${NC} Installing ${GREEN}builbo${NC} to ${INSTALL_BIN_DIR}..."
# 1. Download the script to a temporary location
TMP_FILE=$(mktemp)
if ! curl -fsSL "$SOURCE_URL" -o "$TMP_FILE"; then
echo -e "${RED}Error:${NC} Download failed. Please check the source URL."
exit 1
fi
# 2. Move and set permissions using sudo
echo -e "${BLUE}==>${NC} Requesting admin privileges to complete installation..."
sudo mv "$TMP_FILE" "$INSTALL_PATH"
sudo chmod +x "$INSTALL_PATH"
# 3. Final Verification
if command -v builbo >/dev/null 2>&1; then
echo -e "${GREEN}==> Success!${NC} builbo is now installed."
echo -e "Note: builbo requires ${BLUE}Docker${NC} or ${BLUE}Podman${NC} to run."
else
echo -e "${RED}Error:${NC} Installation failed. Please ensure /usr/local/bin is in your \$PATH."
exit 1
fi