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