Skip to content

Commit

Permalink
feat: electronDownload instead of download electron-userland#921
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Nov 19, 2016
1 parent e05cd17 commit 8463bef
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Don't customize paths to background and icon, — just follow conventions.
| npmArgs | <a name="BuildMetadata-npmArgs"></a>Additional command line arguments to use when installing app native deps. Defaults to `null`.
| nodeGypRebuild | <a name="BuildMetadata-nodeGypRebuild"></a>Whether to execute `node-gyp rebuild` before starting to package the app. Defaults to `false`.
| electronDist | <a name="BuildMetadata-electronDist"></a>The path to custom Electron build (e.g. `~/electron/out/R`). Only macOS supported, file issue if need for Linux or Windows.
| electronDownload | <a name="BuildMetadata-electronDownload"></a>The [electron-download](https://github.com/electron-userland/electron-download#usage) options.
| publish | <a name="BuildMetadata-publish"></a>See [.build.publish](#PublishConfiguration).

<a name="DmgOptions"></a>
Expand Down
7 changes: 6 additions & 1 deletion src/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,16 @@ export interface BuildMetadata {
*/
readonly nodeGypRebuild?: boolean

/**
/*
The path to custom Electron build (e.g. `~/electron/out/R`). Only macOS supported, file issue if need for Linux or Windows.
*/
readonly electronDist?: string

/*
The [electron-download](https://github.com/electron-userland/electron-download#usage) options.
*/
readonly electronDownload?: any

readonly icon?: string | null

// deprecated
Expand Down
6 changes: 5 additions & 1 deletion src/packager/dirPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ import * as path from "path"
const downloadElectron: (options: any) => Promise<any> = BluebirdPromise.promisify(require("electron-download-tf"))

function createDownloadOpts(opts: any, platform: string, arch: string, electronVersion: string) {
if (opts.download != null) {
warn(`"build.download is deprecated — please use build.electronDownload instead`)
}

const downloadOpts = Object.assign({
cache: opts.cache,
strictSSL: opts["strict-ssl"]
}, opts.download)
}, opts.electronDownload || opts.download)

subOptionWarning(downloadOpts, "download", "platform", platform)
subOptionWarning(downloadOpts, "download", "arch", arch)
Expand Down

0 comments on commit 8463bef

Please sign in to comment.