How to use the electron-installer-common.readElectronVersion function in electron-installer-common

To help you get started, we’ve selected a few electron-installer-common 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-userland / electron-installer-redhat / src / installer.js View on Github external
async generateDefaults () {
    const electronVersion = await common.readElectronVersion(this.userSupplied.src)
    const [pkg, requires] = await Promise.all([
      (async () => (await common.readMetadata(this.userSupplied)) || {})(),
      redhatDependencies.forElectron(electronVersion, this.userSupplied.logger)
    ])
    this.defaults = {
      ...common.getDefaultsFromPackageJSON(pkg, { revision: 1 }),
      version: pkg.version || '0.0.0',
      license: pkg.license,
      compressionLevel: 2,
      icon: path.resolve(__dirname, '../resources/icon.png'),
      pre: undefined,
      post: undefined,
      preun: undefined,
      postun: undefined,
      ...requires
    }
github electron-userland / electron-installer-debian / src / installer.js View on Github external
async generateDefaults () {
    const [pkg, size, electronVersion] = await Promise.all([
      (async () => (await common.readMetadata(this.userSupplied)) || {})(),
      fsize(this.userSupplied.src),
      common.readElectronVersion(this.userSupplied.src)
    ])

    this.defaults = Object.assign(common.getDefaultsFromPackageJSON(pkg), {
      version: transformVersion(pkg.version || '0.0.0'),

      section: 'utils',
      priority: 'optional',
      size: Math.ceil((size || 0) / 1024),

      maintainer: this.getMaintainer(pkg.author),

      icon: path.resolve(__dirname, '../resources/icon.png'),
      lintianOverrides: []
    }, debianDependencies.forElectron(electronVersion))

    return this.defaults
github electron-userland / electron-installer-snap / src / yaml.js View on Github external
if (userSupplied.appPlugs) {
      appPlugsSlots.apps.electronApp.plugs = userSupplied.appPlugs
      delete userSupplied.appPlugs
    }
    if (userSupplied.appSlots) {
      appPlugsSlots.apps.electronApp.slots = userSupplied.appSlots
      delete userSupplied.appSlots
    }

    merge(this.data, userSupplied, appConfig, appPlugsSlots)

    this.renameSubtree(this.data.parts, 'electronApp', this.appName)
    this.renameSubtree(this.data.apps, 'electronApp', this.appName)
    this.validateSummary()
    this.app.command = createDesktopLaunchCommand(this.data)
    this.electronVersion = await common.readElectronVersion(packageDir)
    this.transformFeatures()
    return this.transformParts(packageDir)
  }