Skip to content

Commit

Permalink
fix(dmg): type: "file" is not required anymore for app file
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Oct 7, 2016
1 parent 993dac7 commit 96d9206
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
22 changes: 13 additions & 9 deletions src/targets/dmg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -142,14 +154,6 @@ export class DmgTarget extends Target {
async computeDmgOptions(): Promise<DmgOptions> {
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,
Expand Down

0 comments on commit 96d9206

Please sign in to comment.