Skip to content

Commit c9e23e3

Browse files
fix(packager): fix custom afterCopy, afterPrune not being included
As per MDN --> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat the concat method does not change existing arrays but returns a new one. We can use the spread operator and push to achieve what we want
1 parent 7d22d16 commit c9e23e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/api/package.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ export default async (providedOptions = {}) => {
115115
done();
116116
});
117117

118-
afterCopyHooks.concat(resolveHooks(forgeConfig.electronPackagerConfig.afterCopy, dir));
118+
afterCopyHooks.push(...resolveHooks(forgeConfig.electronPackagerConfig.afterCopy, dir));
119119

120120
const afterPruneHooks = [];
121121

122122
if (pruneEnabled) {
123123
afterPruneHooks.push(rebuildHookFn);
124-
afterPruneHooks.concat(resolveHooks(forgeConfig.electronPackagerConfig.afterPrune, dir));
124+
afterPruneHooks.push(...resolveHooks(forgeConfig.electronPackagerConfig.afterPrune, dir));
125125
}
126126

127127
const packageOpts = Object.assign({

0 commit comments

Comments
 (0)