Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/**
* Path to the icon to use for the app in the DMG window.
*/
icon?: string;
icon?: string | string[];
/**
* How big to make the icon for the app in the DMG.
*
Expand Down Expand Up @@ -157,7 +157,15 @@
if (!opts.icon) {
spec.icon = path.resolve(__dirname, '../resources/mac/electron.icns');
} else {
spec.icon = path.resolve(opts.icon);
const iconFilenames = Array.isArray(opts.icon)
? opts.icon
: [opts.icon];
for (let iconFilename of iconFilenames) {

Check failure on line 163 in src/index.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

'iconFilename' is never reassigned. Use 'const' instead

Check failure on line 163 in src/index.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

'iconFilename' is never reassigned. Use 'const' instead
const ext = path.extname(iconFilename);
if (ext !== 'icns') {
spec.icon = path.resolve(iconFilename);
}
}
}

spec['icon-size'] = opts.iconSize || 80;
Expand Down
Loading