From b02ce7697fd2a3c2c79e1f6ab6bf7052125865cc Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Sat, 24 Jun 2023 22:38:09 -0700 Subject: [PATCH] feat: add infoPlistsToIgnore prop to prevent modification (#72) --- src/index.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 34fec69..65eb5d6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -44,6 +44,10 @@ export type MakeUniversalOpts = { * Minimatch pattern of binaries that are expected to be the same x64 binary in both of the ASAR files. */ x64ArchFiles?: string; + /** + * Minimatch pattern of paths that should not receive an injected ElectronAsarIntegrity value + */ + infoPlistsToIgnore?: string; }; const dupedFiles = (files: AppFile[]) => @@ -321,7 +325,12 @@ export const makeUniversalApp = async (opts: MakeUniversalOpts): Promise = ); } - const mergedPlist = { ...x64Plist, ElectronAsarIntegrity: generatedIntegrity }; + const injectAsarIntegrity = + !opts.infoPlistsToIgnore || + minimatch(plistFile.relativePath, opts.infoPlistsToIgnore, { matchBase: true }); + const mergedPlist = injectAsarIntegrity + ? { ...x64Plist, ElectronAsarIntegrity: generatedIntegrity } + : { ...x64Plist }; await fs.writeFile(path.resolve(tmpApp, plistFile.relativePath), plist.build(mergedPlist)); }