How to use the electron-builder-util/out/fs.copyDir 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 / packager / dirPackager.ts View on Github external
async function unpack(packager: PlatformPackager, out: string, platform: string, options: any) {
  const dist = packager.config.electronDist
  if (dist == null) {
    const zipPath = (await BluebirdPromise.all([
      downloadElectron(options),
      emptyDir(out)
    ]))[0]

    await spawn(path7za, debug7zArgs("x").concat(zipPath, `-o${out}`))
  }
  else {
    await emptyDir(out)
    await copyDir(path.resolve(packager.info.projectDir, dist, "Electron.app"), path.join(out, "Electron.app"))
  }

  if (platform === "linux") {
    // https://github.com/electron-userland/electron-builder/issues/786
    // fix dir permissions — opposite to extract-zip, 7za creates dir with no-access for other users, but dir must be readable for non-root users
    await BluebirdPromise.all([
      chmod(path.join(out, "locales"), "0755"),
      chmod(path.join(out, "resources"), "0755")
    ])
  }
}

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