From 96d9206c14c9aeebefa8fdb1049fe182c1cd2a47 Mon Sep 17 00:00:00 2001 From: develar Date: Fri, 7 Oct 2016 14:41:37 +0200 Subject: [PATCH] fix(dmg): type: "file" is not required anymore for app file --- docs/Options.md | 2 +- src/targets/dmg.ts | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/docs/Options.md b/docs/Options.md index 4d8f1ff7c89..b0c7071f69e 100644 --- a/docs/Options.md +++ b/docs/Options.md @@ -7,7 +7,7 @@ In the development `package.json` custom `build` field can be specified to custo "contents": [ { "x": 130, - "y": 220, + "y": 220 }, { "x": 410, diff --git a/src/targets/dmg.ts b/src/targets/dmg.ts index 755bcf372c9..ac255e86156 100644 --- a/src/targets/dmg.ts +++ b/src/targets/dmg.ts @@ -67,9 +67,21 @@ export class DmgTarget extends Target { exec("ln", ["-s", "/Applications", `${volumePath}/Applications`]), ] - const contents = specification.contents!! + let contents = specification.contents + if (contents == null) { + contents = [ + { + "x": 130, "y": 220 + }, + { + "x": 410, "y": 220, "type": "link", "path": "/Applications" + } + ] + } + const location: DmgContent = contents.find(it => it.path == null && it.type !== "link")! const applicationsLocation: DmgContent = contents.find(it => it.type === "link" && (it.path === "/Applications" || it.path === "Applications"))! + const window = specification.window! const env = Object.assign({}, process.env, { volumePath: volumePath, @@ -142,14 +154,6 @@ export class DmgTarget extends Target { async computeDmgOptions(): Promise { const packager = this.packager const specification: any = deepAssign({ - contents: [ - { - "x": 410, "y": 220, "type": "link", "path": "/Applications" - }, - { - "x": 130, "y": 220, - } - ], window: { x: 400, y: 100,