From 688ccf05cbdd3598df21d935240be737c6424fc8 Mon Sep 17 00:00:00 2001 From: Joshua MARTINELLE Date: Thu, 26 Feb 2026 09:38:51 +0100 Subject: [PATCH 1/2] Format --- scripts/install.sh | 104 ++++++++++++++++++++++----------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 57882114..7f5c2cfa 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -140,7 +140,7 @@ detect_os() { log_warn "Unknown operating system" ;; esac - + log_success "Detected: $OS ($DISTRO)" } @@ -150,7 +150,7 @@ detect_os() { install_uv() { log_info "Checking for uv package manager..." - + # Check common locations for uv if command -v uv &> /dev/null; then UV_CMD="uv" @@ -158,7 +158,7 @@ install_uv() { log_success "uv found ($UV_VERSION)" return 0 fi - + # Check ~/.local/bin (default uv install location) even if not on PATH yet if [ -x "$HOME/.local/bin/uv" ]; then UV_CMD="$HOME/.local/bin/uv" @@ -166,7 +166,7 @@ install_uv() { log_success "uv found at ~/.local/bin ($UV_VERSION)" return 0 fi - + # Check ~/.cargo/bin (alternative uv install location) if [ -x "$HOME/.cargo/bin/uv" ]; then UV_CMD="$HOME/.cargo/bin/uv" @@ -174,7 +174,7 @@ install_uv() { log_success "uv found at ~/.cargo/bin ($UV_VERSION)" return 0 fi - + # Install uv log_info "Installing uv (fast Python package manager)..." if curl -LsSf https://astral.sh/uv/install.sh | sh 2>/dev/null; then @@ -201,7 +201,7 @@ install_uv() { check_python() { log_info "Checking Python $PYTHON_VERSION..." - + # Let uv handle Python — it can download and manage Python versions # First check if a suitable Python is already available if $UV_CMD python find "$PYTHON_VERSION" &> /dev/null; then @@ -210,7 +210,7 @@ check_python() { log_success "Python found: $PYTHON_FOUND_VERSION" return 0 fi - + # Python not found — use uv to install it (no sudo needed!) log_info "Python $PYTHON_VERSION not found, installing via uv..." if $UV_CMD python install "$PYTHON_VERSION"; then @@ -226,16 +226,16 @@ check_python() { check_git() { log_info "Checking Git..." - + if command -v git &> /dev/null; then GIT_VERSION=$(git --version | awk '{print $3}') log_success "Git $GIT_VERSION found" return 0 fi - + log_error "Git not found" log_info "Please install Git:" - + case "$OS" in linux) case "$DISTRO" in @@ -258,7 +258,7 @@ check_git() { log_info " Or: brew install git" ;; esac - + exit 1 } @@ -523,7 +523,7 @@ show_manual_install_hint() { clone_repo() { log_info "Installing to $INSTALL_DIR..." - + if [ -d "$INSTALL_DIR" ]; then if [ -d "$INSTALL_DIR/.git" ]; then log_info "Existing installation found, updating..." @@ -556,14 +556,14 @@ clone_repo() { fi fi fi - + cd "$INSTALL_DIR" - + # Ensure submodules are initialized and updated (for existing installs or if --recurse failed) log_info "Initializing submodules (mini-swe-agent, tinker-atropos)..." git submodule update --init --recursive log_success "Submodules ready" - + log_success "Repository ready" } @@ -572,33 +572,33 @@ setup_venv() { log_info "Skipping virtual environment (--no-venv)" return 0 fi - + log_info "Creating virtual environment with Python $PYTHON_VERSION..." - + if [ -d "venv" ]; then log_info "Virtual environment already exists, recreating..." rm -rf venv fi - + # uv creates the venv and pins the Python version in one step $UV_CMD venv venv --python "$PYTHON_VERSION" - + log_success "Virtual environment ready (Python $PYTHON_VERSION)" } install_deps() { log_info "Installing dependencies..." - + if [ "$USE_VENV" = true ]; then # Tell uv to install into our venv (no need to activate) export VIRTUAL_ENV="$INSTALL_DIR/venv" fi - + # Install the main package in editable mode with all extras $UV_CMD pip install -e ".[all]" || $UV_CMD pip install -e "." - + log_success "Main package installed" - + # Install submodules log_info "Installing mini-swe-agent (terminal tool backend)..." if [ -d "mini-swe-agent" ] && [ -f "mini-swe-agent/pyproject.toml" ]; then @@ -607,7 +607,7 @@ install_deps() { else log_warn "mini-swe-agent not found (run: git submodule update --init)" fi - + log_info "Installing tinker-atropos (RL training backend)..." if [ -d "tinker-atropos" ] && [ -f "tinker-atropos/pyproject.toml" ]; then $UV_CMD pip install -e "./tinker-atropos" || log_warn "tinker-atropos install failed (RL tools may not work)" @@ -615,13 +615,13 @@ install_deps() { else log_warn "tinker-atropos not found (run: git submodule update --init)" fi - + log_success "All dependencies installed" } setup_path() { log_info "Setting up hermes command..." - + if [ "$USE_VENV" = true ]; then HERMES_BIN="$INSTALL_DIR/venv/bin/hermes" else @@ -631,12 +631,12 @@ setup_path() { return 0 fi fi - + # Create symlink in ~/.local/bin (standard user binary location, usually on PATH) mkdir -p "$HOME/.local/bin" ln -sf "$HERMES_BIN" "$HOME/.local/bin/hermes" log_success "Symlinked hermes → ~/.local/bin/hermes" - + # Check if ~/.local/bin is on PATH; if not, add it to shell config if ! echo "$PATH" | tr ':' '\n' | grep -q "^$HOME/.local/bin$"; then SHELL_CONFIG="" @@ -649,9 +649,9 @@ setup_path() { elif [ -n "$ZSH_VERSION" ] || [ -f "$HOME/.zshrc" ]; then SHELL_CONFIG="$HOME/.zshrc" fi - + PATH_LINE='export PATH="$HOME/.local/bin:$PATH"' - + if [ -n "$SHELL_CONFIG" ]; then if ! grep -q '\.local/bin' "$SHELL_CONFIG" 2>/dev/null; then echo "" >> "$SHELL_CONFIG" @@ -665,19 +665,19 @@ setup_path() { else log_info "~/.local/bin already on PATH" fi - + # Export for current session so hermes works immediately export PATH="$HOME/.local/bin:$PATH" - + log_success "hermes command ready" } copy_config_templates() { log_info "Setting up configuration files..." - + # Create ~/.hermes directory structure (config at top level, code in subdir) mkdir -p "$HERMES_HOME"/{cron,sessions,logs,pairing,hooks,image_cache,audio_cache,memories,skills,whatsapp/session} - + # Create .env at ~/.hermes/.env (top level, easy to find) if [ ! -f "$HERMES_HOME/.env" ]; then if [ -f "$INSTALL_DIR/.env.example" ]; then @@ -690,7 +690,7 @@ copy_config_templates() { else log_info "~/.hermes/.env already exists, keeping it" fi - + # Create config.yaml at ~/.hermes/config.yaml (top level, easy to find) if [ ! -f "$HERMES_HOME/config.yaml" ]; then if [ -f "$INSTALL_DIR/cli-config.yaml.example" ]; then @@ -700,13 +700,13 @@ copy_config_templates() { else log_info "~/.hermes/config.yaml already exists, keeping it" fi - + # Create SOUL.md if it doesn't exist (global persona file) if [ ! -f "$HERMES_HOME/SOUL.md" ]; then cat > "$HERMES_HOME/SOUL.md" << 'SOUL_EOF' # Hermes Agent Persona -