@@ -313,14 +313,19 @@ exit 0
|
313 | 313 | expect(scriptPath.endsWith(".cmd")).toBe(true); |
314 | 314 | expect(content).toContain("@echo off"); |
315 | 315 | expect(content).toContain("powershell -NoProfile -ExecutionPolicy Bypass -Command"); |
316 | | -expect(content).not.toContain("-File"); |
| 316 | +expect(content).not.toContain("powershell -NoProfile -ExecutionPolicy Bypass -File"); |
317 | 317 | expect(content).toContain('$ErrorActionPreference = "Continue"'); |
318 | 318 | expect(content).toContain("gateway-restart.log"); |
319 | 319 | expect(content).toContain("$taskName = 'OpenClaw Gateway'"); |
320 | 320 | expect(content).toContain("function Invoke-OpenClawSchtasksWithTimeout"); |
321 | 321 | expect(content).toContain("function Get-OpenClawScheduledTaskState"); |
| 322 | +expect(content).toContain("function Invoke-OpenClawStartupLauncher"); |
322 | 323 | expect(content).toContain("Get-ScheduledTask -TaskName $TaskName"); |
323 | 324 | expect(content).toContain("openclaw restart skipped schtasks end"); |
| 325 | +expect(content).toContain( |
| 326 | +'$launcherPath = Join-Path $env:USERPROFILE ".openclaw\\gateway.cmd"', |
| 327 | +); |
| 328 | +expect(content).toContain("openclaw restart launched startup fallback"); |
324 | 329 | expectWindowsRestartWaitOrdering(content); |
325 | 330 | expect(content).toContain('del "%~f0" >nul 2>&1'); |
326 | 331 | await cleanupScript(scriptPath); |
@@ -338,6 +343,7 @@ exit 0
|
338 | 343 | expect(content).toContain( |
339 | 344 | 'Invoke-OpenClawSchtasksWithTimeout -Arguments @("/End", "/TN", $taskName) -TimeoutSeconds 10', |
340 | 345 | ); |
| 346 | +expect(content).toContain("$status = Invoke-OpenClawStartupLauncher"); |
341 | 347 | expectWindowsRestartWaitOrdering(content); |
342 | 348 | await cleanupScript(scriptPath); |
343 | 349 | }); |
|