feat: add Linux support, pnpm build fixes, and website updates
- Add Linux x64 platform support (运行.sh, build script, docs) - Fix pnpm-first build logic across all launcher scripts - Update website: 3→4 platforms, Linux in 3-step guide - Update docs: Qwen free tier, StepFun model, 省钱提示 - Fix .gitignore for build artifacts
This commit is contained in:
@@ -34,6 +34,7 @@ fi
|
||||
|
||||
NODE_BIN="$NODE_DIR/bin/node"
|
||||
NPM_BIN="$NODE_DIR/bin/npm"
|
||||
PNPM_BIN="$NODE_DIR/bin/pnpm"
|
||||
|
||||
if [ ! -f "$NODE_BIN" ]; then
|
||||
echo -e " ${RED}错误: 找不到 Node.js 运行环境${NC}"
|
||||
@@ -49,6 +50,21 @@ echo ""
|
||||
|
||||
export PATH="$NODE_DIR/bin:$PATH"
|
||||
|
||||
ensure_pnpm() {
|
||||
if [ -x "$PNPM_BIN" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo -e " ${YELLOW}缺少 pnpm,正在补充安装...${NC}"
|
||||
"$NPM_BIN" install -g pnpm --registry=https://registry.npmmirror.com 2>&1
|
||||
|
||||
if [ ! -x "$PNPM_BIN" ]; then
|
||||
echo -e " ${RED}错误: pnpm 安装失败,无法继续构建${NC}"
|
||||
read -p " 按回车键退出..."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 检查依赖
|
||||
if [ ! -d "$OPENCLAW_DIR/node_modules" ]; then
|
||||
echo -e " ${YELLOW}首次运行,正在安装依赖...${NC}"
|
||||
@@ -65,7 +81,8 @@ fi
|
||||
if [ ! -d "$OPENCLAW_DIR/dist" ]; then
|
||||
echo -e " ${YELLOW}首次运行,正在构建...${NC}"
|
||||
cd "$OPENCLAW_DIR"
|
||||
"$NODE_BIN" "$NPM_BIN" run build 2>&1
|
||||
ensure_pnpm
|
||||
"$PNPM_BIN" run build 2>&1
|
||||
if [ ! -d "$OPENCLAW_DIR/dist" ]; then
|
||||
echo -e " ${RED}构建失败,请检查错误信息${NC}"
|
||||
read -p " 按回车键退出..."
|
||||
|
||||
Reference in New Issue
Block a user