Skip to content

Commit

Permalink
feat: add infoPlistsToIgnore prop to prevent modification (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound authored Jun 25, 2023
1 parent 85b1f90 commit b02ce76
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[]) =>
Expand Down Expand Up @@ -321,7 +325,12 @@ export const makeUniversalApp = async (opts: MakeUniversalOpts): Promise<void> =
);
}

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));
}
Expand Down

0 comments on commit b02ce76

Please sign in to comment.