Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
arch,
'prune': true,
'app-version': pkg.version || DEFAULT_OPTS.version,
'out': `release/${ plat }-${ arch }`,
})
if (`${ plat }-${ arch }` === 'darwin-x64') {
opts['osx-sign'] = {
app: '/release/darwin-x64/Felony-darwin-x64/Felony.app',
identity: 'xxxxxxxxx', // Developer ID Application: * (*)
}
}
console.log('opts', opts)
packager(opts, cb)
}
if (!packageJSON.version && !packageOpts.appVersion) {
// eslint-disable-next-line max-len
warn(interactive, 'Please set "version" or "config.forge.packagerConfig.appVersion" in your application\'s package.json so auto-updates work properly'.yellow);
}
if (packageOpts.prebuiltAsar) {
throw new Error('config.forge.packagerConfig.prebuiltAsar is not supported by Electron Forge');
}
await runHook(forgeConfig, 'generateAssets');
await runHook(forgeConfig, 'prePackage');
d('packaging with options', packageOpts);
await packager(packageOpts);
await runHook(forgeConfig, 'postPackage');
if (packagerSpinner) packagerSpinner!.succeed();
};
["linux", "win32", "darwin"].forEach(plat => {
packager(assign({}, DEFAULT_OPTS, {
platform: plat,
arch: "x64",
out: config.tempDirectory + "/" + plat
}), () => console.log(plat + " finished!"));
});
})
}).then(() => {
return packager(packagerOptions)
}).then(appPaths => {
let dirName: string | string[] = path.basename(appPaths[0]).split('-')
function runElectronPackager (settings) {
log.log('Electron packager settings:')
log.log(settings)
packager(settings, (err, appPath) => {
if (err) {
return error(err)
}
log.ok(`Application packaged successfully to '${appPath}'`)
})
}
gulp.task('pack:electron', () => {
packager(packagerOptions, function (error, appPath) {
if (error) throw error;
});
});
prune: true,
}
if (plat === 'win32') {
opts = {
...opts,
'version-string': {
CompanyName: companyName,
FileDescription: appName,
OriginalFilename: appName + '.exe',
ProductName: appName,
},
}
}
return packager(opts)
}
const {commonConfig} = await getCommonConfig(envFileResolved, wireJsonResolved);
logger.info(`Building ${commonConfig.name} ${commonConfig.version} for macOS ...`);
const backup = await backupFiles([packageJsonResolved, wireJsonResolved]);
const packageJsonContent = await fs.readJson(packageJsonResolved);
await fs.writeJson(
packageJsonResolved,
{...packageJsonContent, productName: commonConfig.name, version: commonConfig.version},
{spaces: 2},
);
await fs.writeJson(wireJsonResolved, commonConfig, {spaces: 2});
try {
let buildDir = await electronPackager(packagerConfig);
if (Array.isArray(buildDir)) {
buildDir = buildDir[0];
}
logger.log(`Built app in "${buildDir}".`);
if (macOSConfig.certNameInstaller) {
const appFile = path.join(buildDir, `${commonConfig.name}.app`);
await fs.ensureDir(commonConfig.distDir);
const pkgFile = path.join(commonConfig.distDir, `${commonConfig.name}.pkg`);
if (signManually) {
await manualMacOSSign(appFile, pkgFile, commonConfig, macOSConfig);
} else {
await buildPkg({