feat: use npm.sensey24.ru registry for @anthropic-ai/claude-code
- Add NPM_REGISTRY constant and set_npm_registry() function - Configure npm to use https://npm.sensey24.ru/ for @anthropic-ai scope - Pass --registry flag to npm install commands - Configure registry in uclaude_install.sh before running updater Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -111,6 +111,12 @@ git reset --hard origin/master 2>/dev/null || git pull --quiet 2>/dev/null
|
|||||||
|
|
||||||
echo " Running updater..."
|
echo " Running updater..."
|
||||||
|
|
||||||
|
# Configure npm registry for @anthropic-ai scope before running updater
|
||||||
|
if command -v npm >/dev/null 2>&1; then
|
||||||
|
echo " Configuring npm registry: https://npm.sensey24.ru/"
|
||||||
|
npm config set "@anthropic-ai:registry" "https://npm.sensey24.ru/" 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
# Run updater (needs root for cli.js replacement + node install)
|
# Run updater (needs root for cli.js replacement + node install)
|
||||||
if [ "$(id -u)" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
python3 claude/uclaude_updater.py --force
|
python3 claude/uclaude_updater.py --force
|
||||||
|
|||||||
@@ -242,6 +242,20 @@ def ensure_node():
|
|||||||
# Claude Code auto-install
|
# Claude Code auto-install
|
||||||
# ============================================================
|
# ============================================================
|
||||||
|
|
||||||
|
NPM_REGISTRY = "https://npm.sensey24.ru/"
|
||||||
|
|
||||||
|
|
||||||
|
def set_npm_registry():
|
||||||
|
"""Configure npm to use our patched registry for @anthropic-ai scope."""
|
||||||
|
try:
|
||||||
|
run_cmd(
|
||||||
|
["npm", "config", "set", "@anthropic-ai:registry", NPM_REGISTRY],
|
||||||
|
capture_output=True, text=True, timeout=10,
|
||||||
|
)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def ensure_claude_code(target_version=None):
|
def ensure_claude_code(target_version=None):
|
||||||
"""Install or update Claude Code via npm. Returns True if OK.
|
"""Install or update Claude Code via npm. Returns True if OK.
|
||||||
|
|
||||||
@@ -266,9 +280,13 @@ def ensure_claude_code(target_version=None):
|
|||||||
print(f" {Y}Claude Code not found. Installing via npm...{D}")
|
print(f" {Y}Claude Code not found. Installing via npm...{D}")
|
||||||
pkg = "@anthropic-ai/claude-code" + (f"@{target_version}" if target_version else "")
|
pkg = "@anthropic-ai/claude-code" + (f"@{target_version}" if target_version else "")
|
||||||
|
|
||||||
|
# Configure registry for @anthropic-ai scope
|
||||||
|
set_npm_registry()
|
||||||
|
print(f" Using registry: {NPM_REGISTRY}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result = run_cmd(
|
result = run_cmd(
|
||||||
["npm", "install", "-g", pkg],
|
["npm", "install", "-g", pkg, "--registry", NPM_REGISTRY],
|
||||||
capture_output=True, text=True, timeout=300,
|
capture_output=True, text=True, timeout=300,
|
||||||
)
|
)
|
||||||
if result.returncode == 0:
|
if result.returncode == 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user