How to use the app-builder-lib/out/util/appBuilder.executeAppBuilderAsJson 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 / test / src / helpers / packTester.ts View on Github external
async function checkMacResult(packager: Packager, packagerOptions: PackagerOptions, checkOptions: AssertPackOptions, packedAppDir: string) {
  const appInfo = packager.appInfo
  const info = (await executeAppBuilderAsJson>(["decode-plist", "-f", path.join(packedAppDir, "Contents", "Info.plist")]))[0]

  expect(info).toMatchObject({
    CFBundleVersion: info.CFBundleVersion === "50" ? "50" : `${appInfo.version}.${(process.env.TRAVIS_BUILD_NUMBER || process.env.CIRCLE_BUILD_NUM)}`
  })

  // checked manually, remove to avoid mismatch on CI server (where TRAVIS_BUILD_NUMBER is defined and different on each test run)
  delete info.AsarIntegrity
  delete info.CFBundleVersion
  delete info.BuildMachineOSBuild
  delete info.NSHumanReadableCopyright
  delete info.DTXcode
  delete info.DTXcodeBuild
  delete info.DTSDKBuild
  delete info.DTSDKName
  delete info.DTCompiler
  delete info.ElectronTeamID
github electron-userland / electron-builder / packages / dmg-builder / src / dmg.ts View on Github external
env.windowHeight = (window.height || 380).toString()
    }
  }
  else {
    delete env.backgroundColor
  }

  const args = ["dmg", "--volume", volumePath]
  if (specification.icon != null) {
    args.push("--icon", (await packager.getResource(specification.icon))!!)
  }
  if (backgroundFile != null) {
    args.push("--background", backgroundFile)
  }

  const data: any = await executeAppBuilderAsJson(args)
  if (data.backgroundWidth != null) {
    env.windowWidth = window == null ? null : window.width
    env.windowHeight = window == null ? null : window.height

    if (env.windowWidth == null) {
      env.windowWidth = data.backgroundWidth.toString()
    }
    if (env.windowHeight == null) {
      env.windowHeight = data.backgroundHeight.toString()
    }

    if (env.windowX == null) {
      env.windowX = 400
    }
    if (env.windowY == null) {
      env.windowY = Math.round((1440 - env.windowHeight) / 2).toString()