Skip to content

Commit 850eb8a

Browse files
authored
chore: handle windows VM running on macOS silicon (#84)
1 parent 2ad9819 commit 850eb8a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/lib/ggshield-resolver-utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ export function computeGGShieldFolderName(
100100
break;
101101
case "arm64":
102102
archString = "arm64";
103+
// win32 + arm64 -> rely on x86_64 emulation on ARM
104+
if (platform === "win32") {
105+
archString = "x86_64";
106+
}
103107
break;
104108
default:
105109
console.log(`Unsupported architecture: ${arch}`);

src/test/suite/lib/ggshield-resolver-utils.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,22 @@ suite("ggshield-resolver-utils", () => {
158158
),
159159
);
160160
});
161+
test("computes correct path for Windows arm64", () => {
162+
const result = getGGShieldUtils.computeGGShieldPath(
163+
"win32",
164+
"arm64",
165+
ggshieldFolder,
166+
version,
167+
);
168+
assert.strictEqual(
169+
result,
170+
path.join(
171+
ggshieldFolder,
172+
"ggshield-1.0.0-x86_64-pc-windows-msvc",
173+
"ggshield.exe",
174+
),
175+
);
176+
});
161177

162178
test("computes correct path for Linux", () => {
163179
const result = getGGShieldUtils.computeGGShieldPath(

0 commit comments

Comments
 (0)