mirror of
https://github.com/morluto/rea.git
synced 2026-12-02 13:11:18 -05:00
22 lines
739 B
TypeScript
22 lines
739 B
TypeScript
import { mkdir, writeFile } from "node:fs/promises";
|
|
import { join } from "node:path";
|
|
import { thinMach } from "../../src/domain/binaryTarget.fixture.js";
|
|
|
|
/** Write a synthetic app shell; each caller supplies its own plist and archives. */
|
|
export const writeInterfaceBuilderBundle = async (
|
|
app: string,
|
|
executable: string,
|
|
infoPlist: string,
|
|
): Promise<string> => {
|
|
const contents = join(app, "Contents");
|
|
const resources = join(contents, "Resources");
|
|
await mkdir(resources, { recursive: true });
|
|
await mkdir(join(contents, "MacOS"));
|
|
await writeFile(
|
|
join(contents, "MacOS", executable),
|
|
thinMach(0xfeedfacf, 0x0100000c),
|
|
);
|
|
await writeFile(join(contents, "Info.plist"), infoPlist);
|
|
return resources;
|
|
};
|