Files
unlimitedcoding/claude/uclaude_install.sh
delta-cloud-208e 903520b0f9 refactor: перенос файлов в claude/ + мульти-продуктовая структура
- Все claude-файлы перенесены в claude/ (uclaude_updater.py, скрипты, config)
- claude/README.md с инструкцией для Claude Code
- Корневой README — общий для всех продуктов (claude, codex, gemini, qwen, antigravity)
- Node.js v24.13+ автоустановка через nodesource
- Sparse checkout: клиент скачивает только latest версию cli.js

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 11:51:09 +00:00

58 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
# UClaude — one-line installer
# Usage: bash <(curl -s https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/claude/uclaude_install.sh)
set -e
REPO_URL="https://git.sensey24.ru/aibot777/unlimitedcoding.git"
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."
if [ -d "$INSTALL_DIR/.git" ]; then
echo " Already cloned, updating..."
cd "$INSTALL_DIR"
git fetch --depth 1 origin master 2>/dev/null
git reset --hard origin/master 2>/dev/null
else
echo " Cloning (shallow, sparse — only latest version)..."
# Shallow clone without checkout
git clone --depth 1 --no-checkout "$REPO_URL" "$INSTALL_DIR"
cd "$INSTALL_DIR"
# Enable sparse checkout: root + claude core files + index.json (first pass)
git sparse-checkout init --no-cone
git sparse-checkout set '/*' 'claude/*' '!claude/releases/v*' 'claude/releases/index.json'
git checkout 2>/dev/null
# Read latest version from index.json and add only that release dir
if [ -f claude/releases/index.json ]; then
VER=$(python3 -c "import json; print(json.load(open('claude/releases/index.json'))['latest'])")
echo " Latest version: v${VER}"
git sparse-checkout add "claude/releases/v${VER}"
git checkout 2>/dev/null
fi
fi
echo ""
echo " Running updater..."
# Run updater (needs root for cli.js replacement)
if [ "$(id -u)" -eq 0 ]; then
python3 claude/uclaude_updater.py --force
else
echo " Root privileges required to install cli.js."
sudo python3 claude/uclaude_updater.py --force
fi
echo ""
echo "=== Installation complete ==="
echo " To update later: cd $INSTALL_DIR && sudo bash claude/uclaude_update.sh"