File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 55 "scripts" : {
66 "helpDoc" : " docsify serve ./docs/docsify" ,
77 "clean" : " easy clean" ,
8- "build" : " easy build" ,
8+ "build" : " NODE_OPTIONS=--openssl-legacy-provider && easy build" ,
99 "debug" : " egg-bin debug" ,
1010 "dev" : " NODE_OPTIONS=--openssl-legacy-provider && egg-bin dev --daemon" ,
1111 "start" : " bash start.sh" ,
Original file line number Diff line number Diff line change 11#! /bin/bash
2+
3+ # 从 env.json 中读取 mcpDeployDir 配置
4+ MCP_DEPLOY_DIR=$( node -pe " require('./env.json').mcpDeployDir" )
5+
6+ # 检查并创建 mcpDeployDir 目录
7+ if [ ! -d " $MCP_DEPLOY_DIR " ]; then
8+ echo " 检测到 MCP 部署目录不存在: $MCP_DEPLOY_DIR "
9+ echo " 正在创建目录并设置权限..."
10+
11+ # 使用 sudo 创建目录
12+ sudo mkdir -p " $MCP_DEPLOY_DIR "
13+
14+ # 将目录所有权授予当前用户
15+ sudo chown -R $( whoami) :$( id -gn) " $MCP_DEPLOY_DIR "
16+
17+ # 设置目录权限为 755 (所有者可读写执行,组和其他用户只读执行)
18+ sudo chmod -R 755 " $MCP_DEPLOY_DIR "
19+
20+ echo " 目录创建完成: $MCP_DEPLOY_DIR "
21+ else
22+ # 检查当前用户是否有写权限
23+ if [ ! -w " $MCP_DEPLOY_DIR " ]; then
24+ echo " 当前用户没有写权限,正在修复权限..."
25+ sudo chown -R $( whoami) :$( id -gn) " $MCP_DEPLOY_DIR "
26+ sudo chmod -R 755 " $MCP_DEPLOY_DIR "
27+ echo " 权限修复完成"
28+ fi
29+ fi
30+
231export NODE_OPTIONS=--openssl-legacy-provider
332yarn
433yarn build
You can’t perform that action at this time.
0 commit comments