fix: merged ASAR does not unpack when there is only one unpacked file (#55)

This commit is contained in:
Quang Lam
2022-10-18 20:17:11 -04:00
committed by GitHub
parent 64cbc83faf
commit 1fc0005ae8

View File

@@ -195,8 +195,15 @@ export const mergeASARs = async ({
const resolvedUnpack = Array.from(unpackedFiles).map((file) => path.join(x64Dir, file));
let unpack: string | undefined;
if (resolvedUnpack.length > 1) {
unpack = `{${resolvedUnpack.join(',')}}`;
} else if (resolvedUnpack.length === 1) {
unpack = resolvedUnpack[0];
}
await asar.createPackageWithOptions(x64Dir, outputAsarPath, {
unpack: `{${resolvedUnpack.join(',')}}`,
unpack,
});
d('done merging');