From aa2b0122878bb3b769e66d2a56a9f31584de1874 Mon Sep 17 00:00:00 2001 From: Maxime GRIS Date: Tue, 6 Jun 2017 22:58:00 +0200 Subject: [PATCH] fix/ favicon path during packaging --- package.js | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/package.js b/package.js index 797e4cbe5..74486acc0 100644 --- a/package.js +++ b/package.js @@ -18,18 +18,13 @@ const DEFAULT_OPTS = { buildVersion: buildVersion }; -const icon = 'assets/favicon'; - -if (icon) { - DEFAULT_OPTS.icon = icon; -} pack(platform, arch, function done(err, appPath) { - if(err) { - console.log(err); - } else { - console.log('Application packaged successfuly!', appPath); - } + if (err) { + console.log(err); + } else { + console.log('Application packaged successfuly!', appPath); + } }); @@ -37,9 +32,10 @@ function pack(plat, arch, cb) { // there is no darwin ia32 electron if (plat === 'darwin' && arch === 'ia32') return; - const iconObj = { - icon: DEFAULT_OPTS.icon + (() => { + const icon = 'src/favicon'; + if (icon) { + DEFAULT_OPTS.icon = icon + (() => { let extension = '.png'; if (plat === 'darwin') { extension = '.icns'; @@ -47,8 +43,8 @@ function pack(plat, arch, cb) { extension = '.ico'; } return extension; - })() - }; + })(); + } const opts = Object.assign({}, DEFAULT_OPTS, { platform: plat,