tahamajs/IE / Projects /cli /install.sh
tahamajs's picture
download
raw
2.03 kB
#!/usr/bin/env bash
# IE Research Platform Developer CLI Installer
# Automatically detects OS/architecture and installs the binary to /usr/local/bin
set -e
BOLD="\033[1m"
GREEN="\033[32m"
CYAN="\033[36m"
RED="\033[31m"
RESET="\033[0m"
echo -e "${BOLD}${CYAN}MioBook Sandbox CLI Installer${RESET}"
echo -e "Detecting system configuration..."
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
# Map architecture names
if [ "$ARCH" = "x86_64" ]; then
ARCH="amd64"
elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then
ARCH="arm64"
fi
echo -e "System detected: ${BOLD}${OS}/${ARCH}${RESET}"
# Determine source binary
BINARY_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BINARY_SOURCE=""
if [ "$OS" = "darwin" ]; then
if [ "$ARCH" = "arm64" ]; then
BINARY_SOURCE="${BINARY_DIR}/bin/ie-cli-darwin-arm64"
else
BINARY_SOURCE="${BINARY_DIR}/bin/ie-cli-darwin-amd64"
fi
elif [ "$OS" = "linux" ]; then
# Default to amd64 for Linux standard sandbox VMs
BINARY_SOURCE="${BINARY_DIR}/bin/ie-cli-linux-amd64"
else
echo -e "${RED}Error: Unsupported operating system: ${OS}${RESET}"
exit 1
fi
if [ ! -f "$BINARY_SOURCE" ]; then
echo -e "${RED}Error: Pre-compiled binary not found: ${BINARY_SOURCE}${RESET}"
echo -e "Please run 'make compile-all' in the cli directory first."
exit 1
fi
INSTALL_DEST="/usr/local/bin/ie-cli"
echo -e "Installing to ${BOLD}${INSTALL_DEST}${RESET}..."
# Copy binary with sudo if needed
if [ -w "/usr/local/bin" ]; then
cp "$BINARY_SOURCE" "$INSTALL_DEST"
chmod +x "$INSTALL_DEST"
else
echo -e "${CYAN}Write permission denied for /usr/local/bin. Requesting sudo...${RESET}"
sudo cp "$BINARY_SOURCE" "$INSTALL_DEST"
sudo chmod +x "$INSTALL_DEST"
fi
echo -e "\n${BOLD}${GREEN}✔ Installation successful!${RESET}"
echo -e "Verify the installation by running:"
echo -e " ${BOLD}ie-cli whoami${RESET}"
echo -e "\nTo get started, initialize a tool project:"
echo -e " ${BOLD}ie-cli init${RESET}\n"

Xet Storage Details

Size:
2.03 kB
·
Xet hash:
eb0006b97f1b2e9c99664eb3cfb19e675b8cd2f6f15e48b14a26f2abccd2714f

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.