How to use the app-builder-lib.Platform.LINUX function in app-builder-lib

To help you get started, we’ve selected a few app-builder-lib 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-builder / packages / electron-builder / src / builder.ts View on Github external
addValue(archToType, archFromString(type.substring(suffixPos + 1)), type.substring(0, suffixPos))
      }
      else {
        for (const arch of commonArch(true)) {
          addValue(archToType, arch, type)
        }
      }
    }
  }

  if (args.mac != null) {
    processTargets(Platform.MAC, args.mac)
  }

  if (args.linux != null) {
    processTargets(Platform.LINUX, args.linux)
  }

  if (args.win != null) {
    processTargets(Platform.WINDOWS, args.win)
  }

  if (targets.size === 0) {
    processTargets(Platform.current(), [])
  }

  const result: any = {...args}
  result.targets = targets

  delete result.dir
  delete result.mac
  delete result.linux
github vladimiry / ElectronMail / scripts / electron-builder / build-appimage.ts View on Github external
async function build(): Promise<{ packageFile: string }> {
    const packager = new Packager({
        targets: Platform.LINUX.createTarget("appimage"),
        config: await getConfig(
            CWD,
            path.join(CWD, "./electron-builder.yml"),
            null,
        ),
    });
    const {artifactPaths: [packageFile]} = await packager.build();

    if (!String(packageFile).endsWith(".AppImage")) {
        throw new Error(`Invalid artifact: "${packageFile}"`);
    }

    return {packageFile};
}
github vladimiry / ElectronMail / scripts / electron-builder / build-snap.ts View on Github external
async function build(): Promise<{ packageFile: string }> {
    const packager = new Packager({
        targets: Platform.LINUX.createTarget("snap"),
        config: await getConfig(
            CWD,
            path.join(CWD, "./electron-builder.yml"),
            null,
        ),
    });
    const {artifactPaths: [packageFile]} = await packager.build();

    if (!String(packageFile).endsWith(".snap")) {
        throw new Error(`Invalid artifact: "${packageFile}"`);
    }

    return {packageFile};
}