From c284a604c03087953110aaec6206335a00229d2a Mon Sep 17 00:00:00 2001 From: dongsheng123132 <90887123+dongsheng123132@users.noreply.github.com> Date: Sat, 14 Mar 2026 17:37:00 +0800 Subject: [PATCH] fix: add migration shim to Menu and Diagnose scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mac-Menu, Mac-Diagnose, and Windows-Diagnose were missing the core-mac/core-win → core migration shim, causing them to fail on existing USB drives that still have the old directory name. --- portable/Mac-Diagnose.command | 5 +++++ portable/Mac-Menu.command | 6 ++++++ portable/Windows-Diagnose.bat | 3 +++ 3 files changed, 14 insertions(+) diff --git a/portable/Mac-Diagnose.command b/portable/Mac-Diagnose.command index a589fd8..7766897 100644 --- a/portable/Mac-Diagnose.command +++ b/portable/Mac-Diagnose.command @@ -49,6 +49,11 @@ else echo -e " ${RED}✗${NC} Node.js: NOT FOUND" fi +# Migration shim: rename old core-mac to core for existing USB users +if [ -d "$UCLAW_DIR/app/core-mac" ] && [ ! -d "$UCLAW_DIR/app/core" ]; then + mv "$UCLAW_DIR/app/core-mac" "$UCLAW_DIR/app/core" +fi + # 2. Check core directory echo "[2/6] Checking core directory..." CORE_DIR="$UCLAW_DIR/app/core" diff --git a/portable/Mac-Menu.command b/portable/Mac-Menu.command index ebfdfab..a524789 100755 --- a/portable/Mac-Menu.command +++ b/portable/Mac-Menu.command @@ -4,6 +4,12 @@ UCLAW_DIR="$(cd "$(dirname "$0")" && pwd)" APP_DIR="$UCLAW_DIR/app" + +# Migration shim: rename old core-mac to core for existing USB users +if [ -d "$APP_DIR/core-mac" ] && [ ! -d "$APP_DIR/core" ]; then + mv "$APP_DIR/core-mac" "$APP_DIR/core" +fi + CORE_DIR="$APP_DIR/core" DATA_DIR="$UCLAW_DIR/data" STATE_DIR="$DATA_DIR/.openclaw" diff --git a/portable/Windows-Diagnose.bat b/portable/Windows-Diagnose.bat index dd0a7c0..10732a0 100644 --- a/portable/Windows-Diagnose.bat +++ b/portable/Windows-Diagnose.bat @@ -35,6 +35,9 @@ if exist "%NODE_BIN%" ( set /a ERROR_COUNT+=1 ) +REM Migration shim: rename old core-win to core for existing USB users +if exist "%UCLAW_DIR%app\core-win" if not exist "%UCLAW_DIR%app\core" ren "%UCLAW_DIR%app\core-win" core + REM 2. Check core directory echo [2/6] 检查 Windows 依赖目录... set "CORE_DIR=%UCLAW_DIR%app\core"