How to use the electron-builder-util.debug function in electron-builder-util

To help you get started, we’ve selected a few electron-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 / electron-builder / src / targets / dmgLicense.ts View on Github external
export async function addLicenseToDmg(packager: PlatformPackager, dmgPath: string) {
  // http://www.owsiak.org/?p=700
  const licenseFiles = await getLicenseFiles(packager)
  if (licenseFiles.length === 0) {
    return
  }

  if (debug.enabled) {
    debug(`License files: ${licenseFiles.join(" ")}`)
  }

  let data = await readFile(path.join(__dirname, "..", "..", "templates", "dmg", "license.txt"), "utf8")
  let counter = 5000
  for (const item of licenseFiles) {
    const kind = item.file.toLowerCase().endsWith(".rtf") ? "RTF" : "TEXT"
    data += `data '${kind}' (${counter}, "${item.langName} SLA") {\n`

    const hex = (await readFile(item.file)).toString("hex").toUpperCase()
    for (let i = 0; i < hex.length; i += 32) {
      data += '$"' + hex.substring(i, Math.min(i + 32, hex.length)) + '"\n'
    }

    data += "};\n\n"
    // noinspection SpellCheckingInspection
    data += `data 'styl' (${counter}, "${item.langName} SLA") {

electron-builder-util

Part of [electron-builder](https://github.com/electron-userland/electron-builder).

MIT
Latest version published 7 years ago

Package Health Score

66 / 100
Full package analysis

Similar packages