How to use the electron-builder.archFromString function in electron-builder

To help you get started, we’ve selected a few electron-builder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wireapp / wire-desktop / bin / build-tools / lib / build-linux.ts View on Github external
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},
    {spaces: 2},
  );
github wireapp / wire-desktop / Gruntfile.js View on Github external
grunt.registerMultiTask('electronbuilder', 'Build Electron apps', function() {
    const options = this.options();
    const {arch, targets} = options;
    delete options.targets;
    delete options.arch;

    const done = this.async();

    electronBuilder
      .build({
        config: options,
        targets: electronBuilder.Platform.LINUX.createTarget(targets, electronBuilder.archFromString(arch)),
      })
      .then(done, done);
  });