Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Problems downloading electron #180 #256

Merged
merged 1 commit into from
Mar 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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