| 98 | } |
| 99 | |
| 100 | function pack(plat, arch, cb) { |
| 101 | // there is no darwin ia32 electron |
| 102 | if (plat === 'darwin' && arch === 'ia32') return |
| 103 | |
| 104 | const iconObj = { |
| 105 | icon: DEFAULT_OPTS.icon + (() => { |
| 106 | let extension = '.png' |
| 107 | if (plat === 'darwin') { |
| 108 | extension = '.icns' |
| 109 | } else if (plat === 'win32') { |
| 110 | extension = '.ico' |
| 111 | } |
| 112 | return extension |
| 113 | })(), |
| 114 | } |
| 115 | |
| 116 | const opts = Object.assign({}, DEFAULT_OPTS, iconObj, { |
| 117 | 'platform': plat, |
| 118 | arch, |
| 119 | 'prune': true, |
| 120 | 'app-version': pkg.version || DEFAULT_OPTS.version, |
| 121 | 'out': `release/${ plat }-${ arch }`, |
| 122 | }) |
| 123 | |
| 124 | if (`${ plat }-${ arch }` === 'darwin-x64') { |
| 125 | opts['osx-sign'] = { |
| 126 | app: '/release/darwin-x64/Felony-darwin-x64/Felony.app', |
| 127 | identity: 'xxxxxxxxx', // Developer ID Application: * (*) |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | console.log('opts', opts) |
| 132 | |
| 133 | packager(opts, cb) |
| 134 | } |
| 135 | |
| 136 | function log(plat, arch) { |
| 137 | return (err, filepath) => { |