fix(portable): honor bundled OpenClaw version on USB
This commit is contained in:
@@ -499,7 +499,7 @@ function togglePw(id) {
|
||||
// --- Build OpenClaw config ---
|
||||
function buildConfig(provider, base, model, apiKey) {
|
||||
var baseConfig = {
|
||||
gateway: { auth: { mode: 'token', token: 'uclaw' }, remote: { token: 'uclaw' } },
|
||||
gateway: { mode: 'local', auth: { mode: 'token', token: 'uclaw' }, remote: { token: 'uclaw' } },
|
||||
commands: { native: 'auto', nativeSkills: 'auto', restart: true, ownerDisplay: 'raw' },
|
||||
meta: { lastTouchedVersion: '2026.3.13', lastTouchedAt: new Date().toISOString() }
|
||||
};
|
||||
|
||||
@@ -105,8 +105,9 @@ if exist "%CORE_DIR%\node_modules\openclaw" goto skip_openclaw_install
|
||||
echo [INSTALL] Installing OpenClaw...
|
||||
if not exist "%CORE_DIR%" mkdir "%CORE_DIR%" 2>nul
|
||||
|
||||
REM Read pinned OpenClaw version from repo root
|
||||
set "OPENCLAW_VERSION_FILE=%~dp0..\OPENCLAW_VERSION"
|
||||
REM Read pinned OpenClaw version from portable root, then repo root in dev checkouts
|
||||
set "OPENCLAW_VERSION_FILE=%~dp0OPENCLAW_VERSION"
|
||||
if not exist "%OPENCLAW_VERSION_FILE%" set "OPENCLAW_VERSION_FILE=%~dp0..\OPENCLAW_VERSION"
|
||||
set "OPENCLAW_VERSION=2026.4.29"
|
||||
if exist "%OPENCLAW_VERSION_FILE%" (
|
||||
for /f "usebackq delims=" %%v in ("%OPENCLAW_VERSION_FILE%") do set "OPENCLAW_VERSION=%%v"
|
||||
|
||||
@@ -204,7 +204,10 @@ if ($AllPlatforms) {
|
||||
|
||||
$packageJsonPath = Join-Path $coreDir "package.json"
|
||||
if (-not (Test-Path -Path $packageJsonPath -PathType Leaf)) {
|
||||
$openclawVersionFile = Join-Path $PSScriptRoot "..\OPENCLAW_VERSION"
|
||||
$openclawVersionFile = Join-Path $PSScriptRoot "OPENCLAW_VERSION"
|
||||
if (-not (Test-Path -Path $openclawVersionFile -PathType Leaf)) {
|
||||
$openclawVersionFile = Join-Path $PSScriptRoot "..\OPENCLAW_VERSION"
|
||||
}
|
||||
$openclawVersion = "2026.4.29"
|
||||
if (Test-Path -Path $openclawVersionFile -PathType Leaf) {
|
||||
$openclawVersion = (Get-Content -Path $openclawVersionFile -Raw).Trim()
|
||||
|
||||
@@ -110,7 +110,10 @@ else
|
||||
mkdir -p "$CORE_DIR"
|
||||
|
||||
# Init package.json if not exists (pinned OpenClaw version from OPENCLAW_VERSION)
|
||||
OPENCLAW_VERSION_FILE="$(dirname "$0")/../OPENCLAW_VERSION"
|
||||
OPENCLAW_VERSION_FILE="$(dirname "$0")/OPENCLAW_VERSION"
|
||||
if [ ! -f "$OPENCLAW_VERSION_FILE" ]; then
|
||||
OPENCLAW_VERSION_FILE="$(dirname "$0")/../OPENCLAW_VERSION"
|
||||
fi
|
||||
OPENCLAW_VERSION="2026.4.29"
|
||||
if [ -f "$OPENCLAW_VERSION_FILE" ]; then
|
||||
OPENCLAW_VERSION="$(tr -d '[:space:]' < "$OPENCLAW_VERSION_FILE")"
|
||||
|
||||
Reference in New Issue
Block a user