





















@@ -236,6 +236,8 @@ describe("install.ps1 failure handling", () => {
236236it("persists user-local portable Git for future git-backed updates", () => {
237237const portableGitRootBody = extractFunctionBody(source, "Get-PortableGitRoot");
238238const portableGitBody = extractFunctionBody(source, "Install-PortableGit");
239+const portableArchitectureBody = extractFunctionBody(source, "Get-WindowsPortableArchitecture");
240+const portableGitDownloadBody = extractFunctionBody(source, "Resolve-PortableGitDownload");
239241const portableGitPathEntriesBody = extractFunctionBody(source, "Get-PortableGitPathEntries");
240242const portableGitPathBody = extractFunctionBody(source, "Ensure-PortableGitOnUserPath");
241243const usePortableGitBody = extractFunctionBody(source, "Use-PortableGitIfPresent");
@@ -250,6 +252,53 @@ describe("install.ps1 failure handling", () => {
250252expect(ensureGitBody).toContain("Ensure-PortableGitOnUserPath");
251253expect(portableGitPathBody).toContain("Add-ToUserPath $pathEntry");
252254expect(portableGitPathBody).toContain("git-backed updates");
255+expect(portableArchitectureBody).toContain("PROCESSOR_ARCHITEW6432");
256+expect(portableArchitectureBody).toContain("PROCESSOR_ARCHITECTURE");
257+expect(portableGitDownloadBody).toContain("Get-WindowsPortableArchitecture");
258+expect(portableGitDownloadBody).toContain("'^MinGit-.*-arm64\\.zip$'");
259+expect(portableGitDownloadBody).toContain("'^MinGit-.*-64-bit\\.zip$'");
260+});
261+262+runIfPowerShell("selects native ARM64 MinGit when the release publishes it", () => {
263+const tempDir = harness.createTempDir("openclaw-install-ps1-");
264+const scriptPath = join(tempDir, "install.ps1");
265+const scriptWithoutEntryPoint = source.replace(ENTRYPOINT_RE, "");
266+writeFileSync(
267+scriptPath,
268+[
269+scriptWithoutEntryPoint,
270+"",
271+"$env:PROCESSOR_ARCHITEW6432 = $null",
272+"$env:PROCESSOR_ARCHITECTURE = 'ARM64'",
273+"function Invoke-RestMethod {",
274+" [pscustomobject]@{",
275+" tag_name = 'v2.54.0.windows.1'",
276+" assets = @(",
277+" [pscustomobject]@{ name = 'MinGit-2.54.0-64-bit.zip'; browser_download_url = 'https://example.test/x64.zip' },",
278+" [pscustomobject]@{ name = 'MinGit-2.54.0-arm64.zip'; browser_download_url = 'https://example.test/arm64.zip' },",
279+" [pscustomobject]@{ name = 'MinGit-2.54.0-busybox-64-bit.zip'; browser_download_url = 'https://example.test/busybox.zip' }",
280+" )",
281+" }",
282+"}",
283+"$download = Resolve-PortableGitDownload",
284+"if ($download.Name -ne 'MinGit-2.54.0-arm64.zip') { throw \"Name=$($download.Name)\" }",
285+"if ($download.Url -ne 'https://example.test/arm64.zip') { throw \"Url=$($download.Url)\" }",
286+"",
287+].join("\n"),
288+);
289+chmodSync(scriptPath, 0o755);
290+291+const result = runPowerShell([
292+"-NoLogo",
293+"-NoProfile",
294+"-ExecutionPolicy",
295+"Bypass",
296+"-File",
297+scriptPath,
298+]);
299+300+expect(result.status).toBe(0);
301+expect(result.stderr).toBe("");
253302});
254303255304it("activates the repo-pinned pnpm version for git installs", () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。