Skip to content

Commit

Permalink
feat(electron-updater): Location of app-update.yml in the dev mode
Browse files Browse the repository at this point in the history
Close #1254
  • Loading branch information
develar committed Apr 10, 2017
1 parent 6f56905 commit 8c73f57
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"///": "all dependencies for all packages (hoisted)",
"dependencies": {
"7zip-bin": "^2.0.4",
"@electron-builder/electron-download": "4.2.1",
"ajv": "^5.0.4-beta.2",
"ajv-keywords": "^2.0.1-beta.2",
"archiver": "^1.3.0",
Expand All @@ -37,7 +38,7 @@
"chromium-pickle-js": "^0.2.0",
"cuint": "^0.2.2",
"debug": "^2.6.3",
"@electron-builder/electron-download": "4.2.1",
"electron-is-dev": "^0.1.2",
"electron-osx-sign": "0.4.4",
"fs-extra-p": "^4.1.0",
"hosted-git-info": "^2.4.1",
Expand All @@ -62,6 +63,7 @@
"yargs": "^7.0.2"
},
"devDependencies": {
"@develar/typescript-json-schema": "0.11.0",
"@types/electron": "^1.4.35",
"@types/ini": "^1.3.29",
"@types/jest": "^19.2.2",
Expand Down Expand Up @@ -89,7 +91,6 @@
"ts-babel": "^3.0.0",
"tslint": "^5.0.0",
"typescript": "^2.2.2",
"@develar/typescript-json-schema": "0.11.0",
"whitespace": "^2.1.0",
"xml2js": "^0.4.17"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/electron-updater/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"js-yaml": "^3.8.3",
"semver": "^5.3.0",
"source-map-support": "^0.4.14",
"electron-builder-http": "~0.0.0-semantic-release"
"electron-builder-http": "~0.0.0-semantic-release",
"electron-is-dev": "^0.1.2"
},
"typings": "./out/electron-updater.d.ts"
}
2 changes: 1 addition & 1 deletion packages/electron-updater/src/AppUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export abstract class AppUpdater extends EventEmitter {

async loadUpdateConfig() {
if (this._appUpdateConfigPath == null) {
this._appUpdateConfigPath = path.join(process.resourcesPath, "app-update.yml")
this._appUpdateConfigPath = require("electron-is-dev") ? path.join(this.app.getAppPath(), "dev-app-update.yml") : path.join(process.resourcesPath, "app-update.yml")
}
return safeLoad(await readFile(this._appUpdateConfigPath, "utf-8"))
}
Expand Down
3 changes: 3 additions & 0 deletions test/src/mac/dmgTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ test.ifAll.ifMac("custom background - new way", () => {
return assertPack("test-app-one", {
targets: Platform.MAC.createTarget(),
config: {
publish: null,
mac: {
icon: "customIcon"
},
Expand Down Expand Up @@ -58,6 +59,7 @@ test.ifMac("no Applications link", () => {
return assertPack("test-app-one", {
targets: Platform.MAC.createTarget(),
config: {
publish: null,
productName: "NoApplicationsLink",
dmg: {
"contents": [
Expand Down Expand Up @@ -131,6 +133,7 @@ test.ifAll.ifMac("disable dmg icon (light), bundleVersion", () => {
return assertPack("test-app-one", {
targets: Platform.MAC.createTarget(),
config: {
publish: null,
dmg: {
icon: null,
},
Expand Down
3 changes: 3 additions & 0 deletions test/src/nsisUpdaterTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ g.__test_app = {
return "0.0.1"
},

getAppPath: function () {
},

on: function () {
// ignored
},
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ ajv@^4.9.1:
json-stable-stringify "^1.0.1"

ajv@^5.0.4-beta.2:
version "5.0.4-beta.2"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.0.4-beta.2.tgz#2b1dbc09cbd69ee0797489894ab38d12c914e121"
version "5.0.4-beta.3"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.0.4-beta.3.tgz#bb87e35a8f04787a3b7e9b7b2756a6acb6ac926c"
dependencies:
co "^4.6.0"
json-stable-stringify "^1.0.1"
Expand Down Expand Up @@ -1288,8 +1288,8 @@ forever-agent@~0.6.1:
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"

form-data@~2.1.1:
version "2.1.2"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.2.tgz#89c3534008b97eada4cbb157d58f6f5df025eae4"
version "2.1.4"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1"
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.5"
Expand Down Expand Up @@ -2655,8 +2655,8 @@ readable-stream@^1.1.8, readable-stream@~1.1.9:
string_decoder "~0.10.x"

readable-stream@^2.0.0, readable-stream@^2.0.5:
version "2.2.8"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.8.tgz#ad28b686f3554c73d39bc32347fa058356624705"
version "2.2.9"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.9.tgz#cf78ec6f4a6d1eb43d26488cac97f042e74b7fc8"
dependencies:
buffer-shims "~1.0.0"
core-util-is "~1.0.0"
Expand Down Expand Up @@ -3247,8 +3247,8 @@ typical@^2.4.2, typical@^2.6.0:
resolved "https://registry.yarnpkg.com/typical/-/typical-2.6.0.tgz#89d51554ab139848a65bcc2c8772f8fb450c40ed"

uglify-js@^2.6:
version "2.8.21"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.21.tgz#1733f669ae6f82fc90c7b25ec0f5c783ee375314"
version "2.8.22"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.22.tgz#d54934778a8da14903fa29a326fb24c0ab51a1a0"
dependencies:
source-map "~0.5.1"
yargs "~3.10.0"
Expand Down

0 comments on commit 8c73f57

Please sign in to comment.