Skip to content

Commit

Permalink
fix: Problems downloading electron electron-userland#180
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Mar 18, 2016
1 parent 46dbfe1 commit 0265db9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ export async function getElectronVersion(packageData: any, packageJsonPath: stri
return (await readJson(path.join(path.dirname(packageJsonPath), "node_modules", "electron-prebuilt", "package.json"))).version
}
catch (e) {
// ignore
if (e.code !== "ENOENT") {
console.warn("Cannot read electron version from electron-prebuilt package.json" + e.message)
}
}

const devDependencies = packageData.devDependencies
Expand Down
19 changes: 18 additions & 1 deletion test/src/BuildTest.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import test from "./helpers/avaEx"
import { assertPack, modifyPackageJson, platform } from "./helpers/packTester"
import { move, mkdirs, outputFile } from "fs-extra-p"
import { move, mkdirs, outputFile, outputJson } from "fs-extra-p"
import { Promise as BluebirdPromise } from "bluebird"
import * as path from "path"
import { assertThat } from "./helpers/fileAssert"
Expand Down Expand Up @@ -53,6 +53,23 @@ test("build in the app package.json", t => {
}), /'build' in the application package\.json .+/)
})

test("version from electron-prebuilt dependency", async () => {
await assertPack("test-app-one", {
platform: [process.platform],
arch: process.arch,
dist: false
}, projectDir => {
return BluebirdPromise.all([
outputJson(path.join(projectDir, "node_modules", "electron-prebuilt", "package.json"), {
version: "0.37.2"
}),
modifyPackageJson(projectDir, data => {
data.devDependencies = {}
})
])
})
})

test("copy extra resource", async () => {
const platform = process.platform
const osName = Platform.fromNodePlatform(platform).buildConfigurationKey
Expand Down

0 comments on commit 0265db9

Please sign in to comment.