Skip to content

Commit

Permalink
fix: statFileInPackage in platformPackager.js creates wrong path
Browse files Browse the repository at this point in the history
Closes #365
  • Loading branch information
develar committed Apr 28, 2016
1 parent e0c3b92 commit 7373131
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,5 @@
"test/out/*"
]
},
"typings": "./out/electron-builder.d.ts",
"publishConfig": {
"tag": "next"
}
"typings": "./out/electron-builder.d.ts"
}
5 changes: 1 addition & 4 deletions src/macPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,7 @@ export default class OsXPackager extends PlatformPackager<OsXBuildOptions> {
}

const emitter = require("appdmg-tf")(dmgOptions)
emitter.on("error", (e: Error) => {
console.error(e)
reject(e)
})
emitter.on("error", reject)
emitter.on("finish", () => resolve())
if (debug.enabled) {
emitter.on("progress", (info: any) => {
Expand Down
2 changes: 1 addition & 1 deletion src/platformPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions>
}
}
else {
const outStat = await statOrNull(path.join(resourcesDir, relativeFile))
const outStat = await statOrNull(path.join(resourcesDir, "app", relativeFile))
return outStat != null && outStat.isFile()
}
}
Expand Down
14 changes: 14 additions & 0 deletions test/src/BuildTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@ test("invalid main in the app package.json (no asar)", t => t.throws(assertPack(
}
}), "Application entry file main.js could not be found in package. Seems like a wrong configuration."))

test("main in the app package.json (no asar)", () => assertPack("test-app", allPlatformsAndCurrentArch(false), {
tempDirCreated: projectDir => {
return BluebirdPromise.all([
move(path.join(projectDir, "app", "index.js"), path.join(projectDir, "app", "main.js")),
modifyPackageJson(projectDir, data => {
data.main = "main.js"
}, true),
modifyPackageJson(projectDir, data => {
data.build.asar = false
})
])
}
}))

test("version from electron-prebuilt dependency", () => assertPack("test-app-one", {
platform: [Platform.fromString(process.platform)],
dist: false
Expand Down

0 comments on commit 7373131

Please sign in to comment.