How to use the electron-packager/targets.hostArch function in electron-packager

To help you get started, we’ve selected a few electron-packager 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 atom / atom / script / lib / package-application.js View on Github external
'use strict';

const assert = require('assert');
const childProcess = require('child_process');
const electronPackager = require('electron-packager');
const fs = require('fs-extra');
const hostArch = require('electron-packager/targets').hostArch;
const includePathInPackagedApp = require('./include-path-in-packaged-app');
const getLicenseText = require('./get-license-text');
const path = require('path');
const spawnSync = require('./spawn-sync');
const template = require('lodash.template');

const CONFIG = require('../config');
const HOST_ARCH = hostArch();

module.exports = function() {
  const appName = getAppName();
  console.log(
    `Running electron-packager on ${
      CONFIG.intermediateAppPath
    } with app name "${appName}"`
  );
  return runPackager({
    appBundleId: 'com.github.atom',
    appCopyright: `Copyright © 2014-${new Date().getFullYear()} GitHub, Inc. All rights reserved.`,
    appVersion: CONFIG.appMetadata.version,
    arch: process.platform === 'darwin' ? 'x64' : HOST_ARCH, // OS X is 64-bit only
    asar: { unpack: buildAsarUnpackGlobExpression() },
    buildVersion: CONFIG.appMetadata.version,
    derefSymlinks: false,

electron-packager

Customize and package your Electron app with OS-specific bundles (.app, .exe, etc.) via JS or CLI

BSD-2-Clause
Latest version published 1 year ago

Package Health Score

58 / 100
Full package analysis