sunboy0628 commited on
Commit
e122727
·
verified ·
1 Parent(s): 0b15617

Update start-openclaw.sh

Browse files
Files changed (1) hide show
  1. start-openclaw.sh +19 -0
start-openclaw.sh CHANGED
@@ -22,6 +22,25 @@ error_exit() {
22
  # 目录创建函数
23
  ensure_directories() {
24
  log "创建必要的目录结构..."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  if [ ! -d "$OPENCLAW_DIR/agents" ]; then
26
  mkdir -p "$OPENCLAW_DIR" \
27
  "$OPENCLAW_DIR/agents/main/agent" \
 
22
  # 目录创建函数
23
  ensure_directories() {
24
  log "创建必要的目录结构..."
25
+
26
+ log "执行高级内存映射:extensions -> /tmp"
27
+
28
+ # 1. 在内存 (/tmp) 中构建一个完全虚拟的插件目录
29
+ # 这样 OpenClaw 所有的“扫盘”动作都在内存完成,网盘 0 压力
30
+ mkdir -p /tmp/openclaw_extensions
31
+
32
+ # 2. 将镜像中全局安装的插件链接到这个【内存目录】
33
+ ln -sf /usr/local/lib/node_modules/@tencent-weixin/openclaw-weixin /tmp/openclaw_extensions/openclaw-weixin
34
+ ln -sf /usr/local/lib/node_modules/@wecom/wecom-openclaw-plugin /tmp/openclaw_extensions/wecom-openclaw-plugin
35
+
36
+ # 3. 核心步骤:将网盘的工作目录指向这个【内存目录】
37
+ # 删掉网盘上可能存在的真实 extensions 文件夹
38
+ rm -rf "$OPENCLAW_DIR/extensions"
39
+ # 创建软链接,让网盘的 extensions 路径直接通往内存
40
+ ln -s /tmp/openclaw_extensions "$OPENCLAW_DIR/extensions"
41
+
42
+ log "✅ 插件目录已通过内存重定向,路径:$OPENCLAW_DIR/extensions"
43
+
44
  if [ ! -d "$OPENCLAW_DIR/agents" ]; then
45
  mkdir -p "$OPENCLAW_DIR" \
46
  "$OPENCLAW_DIR/agents/main/agent" \