How to use the @electron/get.getHostArch function in @electron/get

To help you get started, we’ve selected a few @electron/get 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 electron / electron-packager / test / basic.js View on Github external
test.serial('defaults', util.testSinglePlatform(async (t, opts) => {
  opts.name = 'defaultsTest'
  opts.dir = util.fixtureSubdir('basic')
  delete opts.platform
  delete opts.arch

  const defaultOpts = {
    arch: getHostArch(),
    name: opts.name,
    platform: process.platform
  }

  const paths = await packager(opts)
  t.true(Array.isArray(paths), 'packager call should resolve to an array')
  t.is(paths.length, 1, 'Single-target run should resolve to a 1-item array')

  const finalPath = paths[0]
  t.is(finalPath, path.join(t.context.workDir, common.generateFinalBasename(defaultOpts)),
       'Path should follow the expected format and be in the cwd')
  await util.assertDirectory(t, finalPath, 'The expected output directory should exist')
  const resourcesPath = path.join(finalPath, util.generateResourcesPath(defaultOpts))
  const appPath = path.join(finalPath, generateNamePath(defaultOpts))

  if (common.isPlatformMac(defaultOpts.platform)) {
github electron / electron-packager / src / targets.js View on Github external
validateListFromOptions: function validateListFromOptions (opts, name) {
    if (opts.all) return Array.from(supported[name].values())

    let list = opts[name]
    if (!list) {
      if (name === 'arch') {
        list = getHostArch()
      } else {
        list = process[name]
      }
    } else if (list === 'all') {
      return Array.from(supported[name].values())
    }

    if (!Array.isArray(list)) {
      if (typeof list === 'string') {
        list = list.split(/,\s*/)
      } else {
        return unsupportedListOption(name, list, supported[name])
      }
    }

    const officialElectronPackages = usingOfficialElectronPackages(opts)

@electron/get

Utility for downloading artifacts from different versions of Electron

MIT
Latest version published 5 months ago

Package Health Score

84 / 100
Full package analysis