Spaces:
Running
Running
Claude commited on
Commit ·
43cdcd3
1
Parent(s): 952c001
删除 install-programs.sh,避免重复安装
Browse files- scripts/install-programs.sh +0 -83
scripts/install-programs.sh
DELETED
|
@@ -1,83 +0,0 @@
|
|
| 1 |
-
#!/bin/bash
|
| 2 |
-
# G5: install-programs.sh - apt/pip/npm 环境变量驱动安装
|
| 3 |
-
|
| 4 |
-
set -e
|
| 5 |
-
|
| 6 |
-
echo "[Install] Starting environment setup..."
|
| 7 |
-
|
| 8 |
-
# 系统依赖 (G1.1)
|
| 9 |
-
install_system_deps() {
|
| 10 |
-
echo "[Install] Installing system dependencies..."
|
| 11 |
-
apt-get update
|
| 12 |
-
apt-get install -y --no-install-recommends \
|
| 13 |
-
git \
|
| 14 |
-
openssh-client \
|
| 15 |
-
python3 \
|
| 16 |
-
python3-pip \
|
| 17 |
-
python3-venv \
|
| 18 |
-
curl \
|
| 19 |
-
ca-certificates \
|
| 20 |
-
tar \
|
| 21 |
-
gzip \
|
| 22 |
-
jq \
|
| 23 |
-
vim \
|
| 24 |
-
wget
|
| 25 |
-
apt-get clean
|
| 26 |
-
rm -rf /var/lib/apt/lists/*
|
| 27 |
-
}
|
| 28 |
-
|
| 29 |
-
# Python包 (G1.2)
|
| 30 |
-
install_python_packages() {
|
| 31 |
-
echo "[Install] Installing Python packages..."
|
| 32 |
-
pip3 install --no-cache-dir --break-system-packages \
|
| 33 |
-
huggingface_hub \
|
| 34 |
-
requests \
|
| 35 |
-
pyyaml \
|
| 36 |
-
schedule \
|
| 37 |
-
python-dotenv
|
| 38 |
-
}
|
| 39 |
-
|
| 40 |
-
# Node.js/OpenClaw (G1.3)
|
| 41 |
-
install_openclaw() {
|
| 42 |
-
echo "[Install] Installing OpenClaw..."
|
| 43 |
-
|
| 44 |
-
# 配置npm镜像
|
| 45 |
-
if [ -n "$NPM_CONFIG_REGISTRY" ]; then
|
| 46 |
-
npm config set registry "$NPM_CONFIG_REGISTRY"
|
| 47 |
-
fi
|
| 48 |
-
|
| 49 |
-
# 安装openclaw
|
| 50 |
-
npm install -g openclaw@latest --unsafe-perm --no-audit --no-fund
|
| 51 |
-
|
| 52 |
-
# 验证安装
|
| 53 |
-
if command -v openclaw &> /dev/null; then
|
| 54 |
-
echo "[Install] OpenClaw installed successfully"
|
| 55 |
-
openclaw --version
|
| 56 |
-
else
|
| 57 |
-
echo "[Install] Warning: openclaw command not found after installation"
|
| 58 |
-
fi
|
| 59 |
-
}
|
| 60 |
-
|
| 61 |
-
# 主函数
|
| 62 |
-
main() {
|
| 63 |
-
echo "========================================"
|
| 64 |
-
echo "OpenClaw Environment Installation"
|
| 65 |
-
echo "========================================"
|
| 66 |
-
|
| 67 |
-
# 根据环境变量决定是否安装
|
| 68 |
-
if [ "${INSTALL_SYSTEM_DEPS:-true}" = "true" ]; then
|
| 69 |
-
install_system_deps
|
| 70 |
-
fi
|
| 71 |
-
|
| 72 |
-
if [ "${INSTALL_PYTHON_PKGS:-true}" = "true" ]; then
|
| 73 |
-
install_python_packages
|
| 74 |
-
fi
|
| 75 |
-
|
| 76 |
-
if [ "${INSTALL_OPENCLAW:-true}" = "true" ]; then
|
| 77 |
-
install_openclaw
|
| 78 |
-
fi
|
| 79 |
-
|
| 80 |
-
echo "[Install] Environment setup completed!"
|
| 81 |
-
}
|
| 82 |
-
|
| 83 |
-
main "$@"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|