Skip to content

Commit

Permalink
fix/ favicon path during packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime GRIS committed Jun 6, 2017
1 parent 34f201d commit aa2b012
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions package.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,33 @@ 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);
}

});

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';
} else if (plat === 'win32') {
extension = '.ico';
}
return extension;
})()
};
})();
}

const opts = Object.assign({}, DEFAULT_OPTS, {
platform: plat,
Expand Down

0 comments on commit aa2b012

Please sign in to comment.