Skip to content

Commit b02ce76

Browse files
feat: add infoPlistsToIgnore prop to prevent modification (#72)
1 parent 85b1f90 commit b02ce76

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/index.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ export type MakeUniversalOpts = {
4444
* Minimatch pattern of binaries that are expected to be the same x64 binary in both of the ASAR files.
4545
*/
4646
x64ArchFiles?: string;
47+
/**
48+
* Minimatch pattern of paths that should not receive an injected ElectronAsarIntegrity value
49+
*/
50+
infoPlistsToIgnore?: string;
4751
};
4852

4953
const dupedFiles = (files: AppFile[]) =>
@@ -321,7 +325,12 @@ export const makeUniversalApp = async (opts: MakeUniversalOpts): Promise<void> =
321325
);
322326
}
323327

324-
const mergedPlist = { ...x64Plist, ElectronAsarIntegrity: generatedIntegrity };
328+
const injectAsarIntegrity =
329+
!opts.infoPlistsToIgnore ||
330+
minimatch(plistFile.relativePath, opts.infoPlistsToIgnore, { matchBase: true });
331+
const mergedPlist = injectAsarIntegrity
332+
? { ...x64Plist, ElectronAsarIntegrity: generatedIntegrity }
333+
: { ...x64Plist };
325334

326335
await fs.writeFile(path.resolve(tmpApp, plistFile.relativePath), plist.build(mergedPlist));
327336
}

0 commit comments

Comments
 (0)