feat: full auto-install chain for all platforms
- Wire ensure_claude_code() into cmd_update() — auto npm install if missing - uclaude_install.sh: auto-install git, python3, curl via apt/dnf/yum/brew - uclaude_update.bat: prereq checks with winget install suggestions - uclaude_update.ps1: auto-install via winget (git, python, node) - install_node(): macOS support via brew, RHEL/Fedora via rpm.nodesource - Increased npm install timeout to 300s for slow connections
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# UClaude — one-line installer
|
||||
# UClaude — one-line installer with full auto-install chain
|
||||
# Usage: bash <(curl -s https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/claude/uclaude_install.sh)
|
||||
set -e
|
||||
|
||||
@@ -9,11 +9,59 @@ INSTALL_DIR="${UCLAUDE_DIR:-$HOME/unlimitedcoding}"
|
||||
echo "=== UClaude Installer ==="
|
||||
echo " Install dir: $INSTALL_DIR"
|
||||
|
||||
# Check prerequisites
|
||||
command -v git >/dev/null 2>&1 || { echo "ERROR: git not found. Install git first."; exit 1; }
|
||||
command -v python3 >/dev/null 2>&1 || { echo "ERROR: python3 not found. Install Python 3 first."; exit 1; }
|
||||
# Node.js check — will be auto-installed by updater if needed
|
||||
command -v node >/dev/null 2>&1 || echo "WARNING: node not found. Updater will attempt auto-install."
|
||||
# ---- Auto-install prerequisites ----
|
||||
|
||||
install_pkg() {
|
||||
# Try apt, then yum/dnf, then brew
|
||||
if command -v apt-get >/dev/null 2>&1; then
|
||||
apt-get update -qq && apt-get install -y -qq "$@"
|
||||
elif command -v dnf >/dev/null 2>&1; then
|
||||
dnf install -y -q "$@"
|
||||
elif command -v yum >/dev/null 2>&1; then
|
||||
yum install -y -q "$@"
|
||||
elif command -v brew >/dev/null 2>&1; then
|
||||
brew install "$@"
|
||||
else
|
||||
echo "ERROR: No package manager found. Install $* manually."
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
need_sudo() {
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo " Root privileges required to install packages."
|
||||
echo " Re-run: sudo bash <(curl -s $REPO_URL/raw/branch/master/claude/uclaude_install.sh)"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Git
|
||||
if ! command -v git >/dev/null 2>&1; then
|
||||
echo " git not found, installing..."
|
||||
need_sudo
|
||||
install_pkg git
|
||||
fi
|
||||
|
||||
# Python 3
|
||||
if ! command -v python3 >/dev/null 2>&1; then
|
||||
echo " python3 not found, installing..."
|
||||
need_sudo
|
||||
install_pkg python3
|
||||
fi
|
||||
|
||||
# curl (needed for nodesource)
|
||||
if ! command -v curl >/dev/null 2>&1; then
|
||||
echo " curl not found, installing..."
|
||||
need_sudo
|
||||
install_pkg curl
|
||||
fi
|
||||
|
||||
# Node.js — updater handles version check and auto-install
|
||||
if ! command -v node >/dev/null 2>&1; then
|
||||
echo " Node.js not found. Updater will auto-install."
|
||||
fi
|
||||
|
||||
# ---- Clone / Update repo ----
|
||||
|
||||
if [ -d "$INSTALL_DIR/.git" ]; then
|
||||
echo " Already cloned, updating..."
|
||||
@@ -44,7 +92,7 @@ fi
|
||||
echo ""
|
||||
echo " Running updater..."
|
||||
|
||||
# Run updater (needs root for cli.js replacement)
|
||||
# Run updater (needs root for cli.js replacement + node install)
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
python3 claude/uclaude_updater.py --force
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user