How to use the builder-util.executeAppBuilder function in builder-util

To help you get started, we’ve selected a few builder-util 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 / app-builder-lib / src / targets / fpm.ts View on Github external
...process.env,
      SZA_PATH: path7za,
      SZA_COMPRESSION_LEVEL: packager.compression === "store" ? "0" : "9",
    }

    // rpmbuild wants directory rpm with some default config files. Even if we can use dylibbundler, path to such config files are not changed (we need to replace in the binary)
    // so, for now, brew install rpm is still required.
    if (target !== "rpm" && await isMacOsSierra()) {
      const linuxToolsPath = await getLinuxToolsPath()
      Object.assign(env, {
        PATH: computeEnv(process.env.PATH, [path.join(linuxToolsPath, "bin")]),
        DYLD_LIBRARY_PATH: computeEnv(process.env.DYLD_LIBRARY_PATH, [path.join(linuxToolsPath, "lib")]),
      })
    }

    await executeAppBuilder(["fpm", "--configuration", JSON.stringify(fpmConfiguration)], undefined, {env})

    await packager.dispatchArtifactCreated(artifactPath, this, arch)
  }
}
github electron-userland / electron-builder / packages / app-builder-lib / src / targets / nsis / NsisTarget.ts View on Github external
// after adding blockmap data will be "Warnings: 1" in the end of output
        const match = archiveInfo.match(/(\d+)\s+\d+\s+\d+\s+files/)
        if (match == null) {
          log.warn({output: archiveInfo}, "cannot compute size of app package")
        }
        else {
          estimatedSize += parseInt(match[1], 10)
        }
      })
    }

    this.configureDefinesForAllTypeOfInstaller(defines)
    if (isPortable) {
      const portableOptions = options as PortableOptions
      defines.REQUEST_EXECUTION_LEVEL = portableOptions.requestExecutionLevel || "user"
      defines.UNPACK_DIR_NAME = portableOptions.unpackDirName || (await executeAppBuilder(["ksuid"]))

      if (portableOptions.splashImage != null) {
        defines.SPLASH_IMAGE = portableOptions.splashImage
      }
    }
    else {
      await this.configureDefines(oneClick, defines)
    }

    if (estimatedSize !== 0) {
      // in kb
      defines.ESTIMATED_SIZE = Math.round(estimatedSize / 1024)
    }

    if (packager.compression === "store") {
      commands.SetCompress = "off"
github electron-userland / electron-builder / test / src / helpers / updaterTestUtil.ts View on Github external
download(url: string, destination: string, options: DownloadOptions): Promise {
    const args = ["download", "--url", url, "--output", destination]
    if (options != null && options.sha512) {
      args.push("--sha512", options.sha512)
    }
    return executeAppBuilder(args)
      .then(() => destination)
  }
}
github electron-userland / electron-builder / packages / app-builder-lib / src / binDownload.ts View on Github external
function doGetBin(name: string, url: string | undefined | null, checksum: string | null | undefined): Promise {
  const args = ["download-artifact", "--name", name]
  if (url != null) {
    args.push("--url", url)
  }
  if (checksum != null) {
    args.push("--sha512", checksum)
  }
  return executeAppBuilder(args)
}
github electron-userland / electron-builder / packages / electron-builder-lib / src / remoteBuilder / RemoteBuildManager.ts View on Github external
private downloadArtifacts(files: Array, fileSizes: Array, baseUrl: string) {
    const args = ["download-resolved-files", "--out", this.outDir, "--base-url", this.buildServiceEndpoint + baseUrl]
    for (let i = 0; i < files.length; i++) {
      const artifact = files[i]
      args.push("-f", artifact.file)
      args.push("-s", fileSizes[i].toString())
    }
    return executeAppBuilder(args)
  }
github electron-userland / electron-builder / packages / app-builder-lib / src / util / appBuilder.ts View on Github external
export function executeAppBuilderAsJson(args: Array): Promise {
  return executeAppBuilder(args)
    .then(rawResult => {
      if (rawResult === "") {
        return Object.create(null) as T
      }

      try {
        return JSON.parse(rawResult) as T
      }
      catch (e) {
        throw new Error(`Cannot parse result: ${e.message}: "${rawResult}"`)
      }
    })
}
github electron-userland / electron-builder / packages / app-builder-lib / src / frameworks / LibUiFramework.ts View on Github external
private async prepareLinuxApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions) {
    const appOutDir = options.appOutDir
    await executeAppBuilder(["proton-native", "--node-version", this.version, "--platform", "linux", "--arch", options.arch, "--stage", appOutDir])
    const mainPath = path.join(appOutDir, (options.packager as LinuxPackager).executableName)
    await writeExecutableMain(mainPath, `#!/bin/sh
  DIR=$(dirname "$0")
  "$DIR/node" "$DIR/app/${options.packager.info.metadata.main || "index.js"}"
  `)
  }
github electron-userland / electron-builder / packages / app-builder-lib / src / wine.ts View on Github external
options.timeout = 120 * 1000
    }
    return exec(file, appArgs, options)
  }

  const commandArgs = [
    "wine",
    "--ia32", file,
  ]
  if (file64 != null) {
    commandArgs.push("--x64", file64)
  }
  if (appArgs.length > 0) {
    commandArgs.push("--args", JSON.stringify(appArgs))
  }
  return executeAppBuilder(commandArgs, undefined, options)
}
github electron-userland / electron-builder / packages / app-builder-lib / src / binDownload.ts View on Github external
export function download(url: string, output: string, checksum?: string | null): Promise {
  const args = ["download", "--url", url, "--output", output]
  if (checksum != null) {
    args.push("--sha512", checksum)
  }
  return executeAppBuilder(args) as Promise
}