Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"use strict"
const path = require("path")
const builder = require("electron-builder")
const Platform = builder.Platform
var argv = require('minimist')(process.argv.slice(2));
console.dir();
var fs = require('fs');
var os = argv.os.toUpperCase() // "ia32"
var arch = argv.arch // "ia32"
var p = require("./../package.json");
var fn = path.join(__dirname, "../dist","sulu Setup " + p.version + ".exe");
var fn2 = path.join(__dirname, "../dist","sulu-fileexplorer-" + os + "-" + arch + "-" + p.version + "." + p.stability + ".exe");
var p2 = path.join(__dirname, "../app","package.json");
console.info("patch ", p2, p.version);
var pp2 = JSON.parse(fs.readFileSync(p2).toString())
pp2.version = p.version
gulp.task('stage:mac', function () {
var builder = require('electron-builder');
const config = getConfig("mac", "dir");
console.log(`Electron mirror: ${getElectronMirrorUrl()}`);
return builder.build({
targets: builder.Platform.MAC.createTarget(["dir"]),
config
});
});
gulp.task('stage:windows', function () {
var builder = require('electron-builder');
const config = getConfig("windows", "dir");
console.log(`Electron mirror: ${getElectronMirrorUrl()}`);
return builder.build({
targets: builder.Platform.WINDOWS.createTarget(["dir"], builder.Arch.ia32, builder.Arch.x64),
config
});
});
const argv = require('yargs').parse(process.argv.slice(1));
const ROOT_FOLDER = path.resolve(__dirname, '..', '..');
const targets = [];
if (argv.mac) {
targets.push(builder.Platform.MAC);
}
if (argv.win) {
targets.push(builder.Platform.WINDOWS);
}
if (argv.linux) {
targets.push(builder.Platform.LINUX);
}
builder.build({
targets: builder.createTargets(targets, null, 'all'),
devMetadata: {
build: {
afterPack(params) {
return Q.try(() => {
console.log('Copying LICENSE, AUTHORS, README...');
shell.cp(
path.join(ROOT_FOLDER, 'LICENSE'),
params.appOutDir
);
shell.cp(
async function createDarwinApp() {
return baseBuild({
targets: electronBuilder.Platform.MAC.createTarget(["dir"]),
});
}
export async function buildLinuxWrapper(
builderConfig: electronBuilder.Configuration,
linuxConfig: LinuxConfig,
packageJsonPath: string,
wireJsonPath: string,
envFilePath: string,
): Promise {
const wireJsonResolved = path.resolve(wireJsonPath);
const packageJsonResolved = path.resolve(packageJsonPath);
const envFileResolved = path.resolve(envFilePath);
const {commonConfig} = await getCommonConfig(envFileResolved, wireJsonResolved);
const targets = electronBuilder.Platform.LINUX.createTarget(
linuxConfig.targets,
electronBuilder.archFromString('x64'),
);
logger.info(
`Building ${commonConfig.name} ${commonConfig.version} for Linux (target${
linuxConfig.targets.length === 1 ? '' : 's'
}: ${linuxConfig.targets.join(', ')}) ...`,
);
const backup = await backupFiles([packageJsonResolved, wireJsonResolved]);
const packageJsonContent = await fs.readJson(packageJsonResolved);
await fs.writeJson(
packageJsonResolved,
{...packageJsonContent, productName: commonConfig.name, version: commonConfig.version},
y: 142,
type: 'file'
}
]
}
}
});
fs.writeFileSync(
path.join(__dirname, `../dist_${type}`, 'app', 'package.json'),
JSON.stringify(appPackageJson, null, 2), 'utf-8'
);
const targets = [];
if (options.mac) targets.push(builder.Platform.MAC);
if (options.win) targets.push(builder.Platform.WINDOWS);
if (options.linux) targets.push(builder.Platform.LINUX);
builder.build({
targets: builder.createTargets(targets, null, 'all'),
projectDir: path.join(__dirname, `../dist_${type}`, 'app'),
publish: 'never',
config: {
afterPack(params) {
return Q.try(() => {
shell.cp(
[
path.join(__dirname, '..', 'LICENSE'),
path.join(__dirname, '..', 'README.md'),
path.join(__dirname, '..', 'AUTHORS')
],
params.appOutDir
const os = require('os')
const builder = require('electron-builder')
const Platform = builder.Platform
const { name, productName } = require('../package.json')
let targets
var platform = os.platform()
if (platform == 'darwin') {
targets = Platform.MAC.createTarget()
} else if (platform == 'win32') {
targets = Platform.WINDOWS.createTarget()
} else if (platform == 'linux') {
targets = Platform.LINUX.createTarget()
}
const config = {
appId: `com.mubaidr.${name}`,
copyright: 'Copyright ©2019 mubaidr@gmail.com',
const builder = require("electron-builder");
const fs = require('fs');
const os = process.platform;
const Platform = builder.Platform
const Arch = builder.Arch
const targets = new Map();
const archToType = new Map();
const pref = {
productName: "TheDesk",
appId: "top.thedesk",
asarUnpack: [
"node_modules/itunes-nowplaying-mac"
],
directories: {
output: "../build/"
},
win: {
icon: "build/thedesk.ico",
target: [
"nsis",
"use strict"
var builder = require("electron-builder"),
targets = builder.Platform;
builder.build({
targets: targets.WINDOWS.createTarget(),
config: {
"appId": "com.cemui.app",
"productName": "CemUI",
"asar": true,
"icon": "icon.ico",
"directories": {
"output": "builds"
},
extraResources: [
"defaults",
"uni.cert",
],
files: [