fix: correct openclaw.mjs path and remove broken build step
- openclaw.mjs is at node_modules/openclaw/openclaw.mjs, not core root - Remove npm run build (openclaw doesn't need a build step via npm) - Fix both Mac-Start.command and Mac-Menu.command
This commit is contained in:
@@ -35,9 +35,11 @@ if xattr -l "$NODE_BIN" 2>/dev/null | grep -q "com.apple.quarantine"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Run openclaw command
|
# Run openclaw command
|
||||||
|
OPENCLAW_MJS="$CORE_DIR/node_modules/openclaw/openclaw.mjs"
|
||||||
|
|
||||||
run_oc() {
|
run_oc() {
|
||||||
cd "$CORE_DIR"
|
cd "$CORE_DIR"
|
||||||
"$NODE_BIN" openclaw.mjs "$@"
|
"$NODE_BIN" "$OPENCLAW_MJS" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Show menu
|
# Show menu
|
||||||
@@ -110,7 +112,7 @@ do_dashboard() {
|
|||||||
|
|
||||||
local TOKEN=$(python3 -c "import json,os; p='$CONFIG_PATH'; d=json.load(open(p)) if os.path.exists(p) else {}; print(d.get('gateway',{}).get('auth',{}).get('token','uclaw'))" 2>/dev/null || echo "uclaw")
|
local TOKEN=$(python3 -c "import json,os; p='$CONFIG_PATH'; d=json.load(open(p)) if os.path.exists(p) else {}; print(d.get('gateway',{}).get('auth',{}).get('token','uclaw'))" 2>/dev/null || echo "uclaw")
|
||||||
|
|
||||||
"$NODE_BIN" openclaw.mjs gateway run --allow-unconfigured --force --port $PORT &
|
"$NODE_BIN" "$OPENCLAW_MJS" gateway run --allow-unconfigured --force --port $PORT &
|
||||||
local PID=$!
|
local PID=$!
|
||||||
|
|
||||||
for i in $(seq 1 30); do
|
for i in $(seq 1 30); do
|
||||||
|
|||||||
@@ -106,12 +106,7 @@ if [ ! -d "$CORE_DIR/node_modules" ]; then
|
|||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d "$CORE_DIR/dist" ]; then
|
# OpenClaw doesn't need a separate build step when installed via npm
|
||||||
echo -e " ${YELLOW}First run - building...${NC}"
|
|
||||||
cd "$CORE_DIR"
|
|
||||||
"$NODE_BIN" "$NODE_DIR/bin/npm" run build 2>&1
|
|
||||||
echo ""
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ---- 8. Find available port ----
|
# ---- 8. Find available port ----
|
||||||
PORT=18789
|
PORT=18789
|
||||||
@@ -146,7 +141,8 @@ cd "$CORE_DIR"
|
|||||||
|
|
||||||
TOKEN=$(python3 -c "import json,os; p='$STATE_DIR/openclaw.json' if os.path.exists('$STATE_DIR/openclaw.json') else '$DATA_DIR/config.json'; d=json.load(open(p)); print(d.get('gateway',{}).get('auth',{}).get('token','uclaw'))" 2>/dev/null || echo "uclaw")
|
TOKEN=$(python3 -c "import json,os; p='$STATE_DIR/openclaw.json' if os.path.exists('$STATE_DIR/openclaw.json') else '$DATA_DIR/config.json'; d=json.load(open(p)); print(d.get('gateway',{}).get('auth',{}).get('token','uclaw'))" 2>/dev/null || echo "uclaw")
|
||||||
|
|
||||||
"$NODE_BIN" openclaw.mjs gateway run --allow-unconfigured --force --port $PORT &
|
OPENCLAW_MJS="$CORE_DIR/node_modules/openclaw/openclaw.mjs"
|
||||||
|
"$NODE_BIN" "$OPENCLAW_MJS" gateway run --allow-unconfigured --force --port $PORT &
|
||||||
GW_PID=$!
|
GW_PID=$!
|
||||||
|
|
||||||
# ---- 10. Wait & open browser ----
|
# ---- 10. Wait & open browser ----
|
||||||
|
|||||||
Reference in New Issue
Block a user