惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MyScale Blog
MyScale Blog
T
The Blog of Author Tim Ferriss
博客园 - 三生石上(FineUI控件)
博客园_首页
WordPress大学
WordPress大学
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The GitHub Blog
The GitHub Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Fortinet All Blogs
B
Blog RSS Feed
Stack Overflow Blog
Stack Overflow Blog
Microsoft Security Blog
Microsoft Security Blog
雷峰网
雷峰网
GbyAI
GbyAI
M
MIT News - Artificial intelligence
I
InfoQ
阮一峰的网络日志
阮一峰的网络日志
Recent Announcements
Recent Announcements
小众软件
小众软件
量子位
S
SegmentFault 最新的问题
Google DeepMind News
Google DeepMind News
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(release): stabilize windows npm install · openclaw/op...
steipete · 2026-05-02 · via Recent Commits to openclaw:main

@@ -73,6 +73,44 @@ describe("install.ps1 failure handling", () => {

7373

expect(completeInstallBody).toMatch(/\bthrow "OpenClaw installation failed with exit code/);

7474

});

757576+

it("runs npm capture commands from a writable installer temp directory", () => {

77+

const nativeCaptureBody = extractFunctionBody(source, "Invoke-NativeCommandCapture");

78+

const npmInstallBody = extractFunctionBody(source, "Install-OpenClawNpm");

79+

const mainBody = extractFunctionBody(source, "Main");

80+

expect(source).toContain("function Get-NpmWorkingDirectory {");

81+

expect(nativeCaptureBody).toContain('[string]$WorkingDirectory = ""');

82+

expect(nativeCaptureBody).toContain("$startProcessArgs.WorkingDirectory = $WorkingDirectory");

83+

expect(npmInstallBody).toContain("-WorkingDirectory (Get-NpmWorkingDirectory)");

84+

expect(mainBody).toContain("-WorkingDirectory (Get-NpmWorkingDirectory)");

85+

});

86+87+

runIfPowerShell("creates a temp npm working directory", () => {

88+

const tempDir = harness.createTempDir("openclaw-install-ps1-");

89+

const scriptPath = join(tempDir, "install.ps1");

90+

const scriptWithoutEntryPoint = source.replace(ENTRYPOINT_RE, "");

91+

writeFileSync(

92+

scriptPath,

93+

[

94+

scriptWithoutEntryPoint,

95+

"",

96+

"$result = Get-NpmWorkingDirectory",

97+

'if (!(Test-Path -LiteralPath $result)) { throw "missing $result" }',

98+

'if ($result -notmatch "openclaw-installer") { throw "unexpected $result" }',

99+

"",

100+

].join("\n"),

101+

);

102+

chmodSync(scriptPath, 0o755);

103+104+

const result = spawnSync(

105+

powershell!,

106+

["-NoLogo", "-NoProfile", "-ExecutionPolicy", "Bypass", "-File", scriptPath],

107+

{ encoding: "utf8" },

108+

);

109+110+

expect(result.status).toBe(0);

111+

expect(result.stderr).toBe("");

112+

});

113+76114

runIfPowerShell("exits non-zero when run as a script file", () => {

77115

const tempDir = harness.createTempDir("openclaw-install-ps1-");

78116

const scriptPath = join(tempDir, "install.ps1");

@@ -125,7 +163,7 @@ describe("install.ps1 failure handling", () => {

125163

"function Ensure-Node { return $true }",

126164

"function Add-ToPath { param([string]$Path) }",

127165

"function Invoke-NativeCommandCapture {",

128-

" param([string]$FilePath, [string[]]$Arguments)",

166+

" param([string]$FilePath, [string[]]$Arguments, [string]$WorkingDirectory = '')",

129167

" return @{ ExitCode = 0; Stdout = 'npm stdout'; Stderr = 'npm stderr' }",

130168

"}",

131169

"$NoOnboard = $true",

@@ -167,7 +205,7 @@ describe("install.ps1 failure handling", () => {

167205

" return $true",

168206

"}",

169207

"function Invoke-NativeCommandCapture {",

170-

" param([string]$FilePath, [string[]]$Arguments)",

208+

" param([string]$FilePath, [string[]]$Arguments, [string]$WorkingDirectory = '')",

171209

" return @{ ExitCode = 0; Stdout = 'npm prefix'; Stderr = '' }",

172210

"}",

173211

"$NoOnboard = $true",