Skip to content

Commit cedb1ad

Browse files
t3dotggclaude
andcommitted
fix(desktop): reject a macOS app without app.asar
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 972504c commit cedb1ad

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

‎scripts/build-desktop-artifact.test.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,6 +1342,21 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
13421342
),
13431343
);
13441344

1345+
it.effect("rejects a macOS app without app.asar", () =>
1346+
Effect.scoped(
1347+
Effect.gen(function* () {
1348+
const fs = yield* FileSystem.FileSystem;
1349+
const stageDistDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-mac-payload-test-" });
1350+
yield* fs.makeDirectory(`${stageDistDir}/mac-arm64/T3 Code.app/Contents/Resources`, {
1351+
recursive: true,
1352+
});
1353+
const error = yield* validateMacPackagedPayload({ stageDistDir }).pipe(Effect.flip);
1354+
1355+
assert.instanceOf(error, BundleNotSelfContainedError);
1356+
}),
1357+
),
1358+
);
1359+
13451360
it.effect("leaves the bundle self-check of a cross-built payload to the verify job", () =>
13461361
Effect.scoped(
13471362
Effect.gen(function* () {

‎scripts/build-desktop-artifact.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3540,10 +3540,8 @@ export const validateMacPackagedPayload = Effect.fn("desktopArtifact.validateMac
35403540
const outputDir = path.join(input.stageDistDir, entry);
35413541
const apps = yield* fs.readDirectory(outputDir).pipe(Effect.orElseSucceed(() => []));
35423542
for (const app of apps) {
3543-
if (!app.endsWith(".app")) continue;
3544-
const asarPath = path.join(outputDir, app, "Contents/Resources/app.asar");
3545-
if (yield* fs.exists(asarPath).pipe(Effect.orElseSucceed(() => false))) {
3546-
asarPaths.push(asarPath);
3543+
if (app.endsWith(".app")) {
3544+
asarPaths.push(path.join(outputDir, app, "Contents/Resources/app.asar"));
35473545
}
35483546
}
35493547
}

0 commit comments

Comments
 (0)