Skip to content

Commit

Permalink
fix: merged ASAR does not unpack when there is only one unpacked file (
Browse files Browse the repository at this point in the history
  • Loading branch information
quanglam2807 committed Oct 19, 2022
1 parent 64cbc83 commit 1fc0005
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/asar-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 1fc0005

Please sign in to comment.