Fix macOS icons generation. (#3267)

This commit is contained in:
Michał Wawrzyniec Urbańczyk 2022-02-11 19:01:16 +01:00 committed by GitHub
parent 0c25ee736c
commit c268487ab6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,11 +120,11 @@ exports.generateMinimalWhiteLogo = fastGenerate(AppLogo)
const fss = require('fs')
const fs = fss.promises
const exec = require('child_process').exec
const spawn = require('child_process').spawn
const execSync = require('child_process').execSync
const toIco = require('to-ico')
const sharp = require('sharp')
const path = require('path')
const platform = require('os').platform
const thisPath = path.resolve(__dirname)
const root = path.resolve(thisPath, '..', '..', '..', '..', '..')
@ -178,9 +178,11 @@ async function genIcons() {
.toFile(`${distPath}/png/${outName}`)
}
console.log('Generating ICNS.')
exec(`cp -R ${distPath}/png ${distPath}/png.iconset`)
exec(`iconutil --convert icns --output ${distPath}/icon.icns ${distPath}/png.iconset`)
if (platform() === 'darwin') {
console.log('Generating ICNS.')
execSync(`cp -R ${distPath}/png ${distPath}/png.iconset`)
execSync(`iconutil --convert icns --output ${distPath}/icon.icns ${distPath}/png.iconset`)
}
console.log('Generating ICO.')
let files = []