Skip to content

Commit 8c73f57

Browse files
committed
feat(electron-updater): Location of app-update.yml in the dev mode
Close #1254
1 parent 6f56905 commit 8c73f57

File tree

6 files changed

+20
-12
lines changed

6 files changed

+20
-12
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"///": "all dependencies for all packages (hoisted)",
2929
"dependencies": {
3030
"7zip-bin": "^2.0.4",
31+
"@electron-builder/electron-download": "4.2.1",
3132
"ajv": "^5.0.4-beta.2",
3233
"ajv-keywords": "^2.0.1-beta.2",
3334
"archiver": "^1.3.0",
@@ -37,7 +38,7 @@
3738
"chromium-pickle-js": "^0.2.0",
3839
"cuint": "^0.2.2",
3940
"debug": "^2.6.3",
40-
"@electron-builder/electron-download": "4.2.1",
41+
"electron-is-dev": "^0.1.2",
4142
"electron-osx-sign": "0.4.4",
4243
"fs-extra-p": "^4.1.0",
4344
"hosted-git-info": "^2.4.1",
@@ -62,6 +63,7 @@
6263
"yargs": "^7.0.2"
6364
},
6465
"devDependencies": {
66+
"@develar/typescript-json-schema": "0.11.0",
6567
"@types/electron": "^1.4.35",
6668
"@types/ini": "^1.3.29",
6769
"@types/jest": "^19.2.2",
@@ -89,7 +91,6 @@
8991
"ts-babel": "^3.0.0",
9092
"tslint": "^5.0.0",
9193
"typescript": "^2.2.2",
92-
"@develar/typescript-json-schema": "0.11.0",
9394
"whitespace": "^2.1.0",
9495
"xml2js": "^0.4.17"
9596
},

packages/electron-updater/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"js-yaml": "^3.8.3",
1818
"semver": "^5.3.0",
1919
"source-map-support": "^0.4.14",
20-
"electron-builder-http": "~0.0.0-semantic-release"
20+
"electron-builder-http": "~0.0.0-semantic-release",
21+
"electron-is-dev": "^0.1.2"
2122
},
2223
"typings": "./out/electron-updater.d.ts"
2324
}

packages/electron-updater/src/AppUpdater.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ export abstract class AppUpdater extends EventEmitter {
257257

258258
async loadUpdateConfig() {
259259
if (this._appUpdateConfigPath == null) {
260-
this._appUpdateConfigPath = path.join(process.resourcesPath, "app-update.yml")
260+
this._appUpdateConfigPath = require("electron-is-dev") ? path.join(this.app.getAppPath(), "dev-app-update.yml") : path.join(process.resourcesPath, "app-update.yml")
261261
}
262262
return safeLoad(await readFile(this._appUpdateConfigPath, "utf-8"))
263263
}

test/src/mac/dmgTest.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ test.ifAll.ifMac("custom background - new way", () => {
2929
return assertPack("test-app-one", {
3030
targets: Platform.MAC.createTarget(),
3131
config: {
32+
publish: null,
3233
mac: {
3334
icon: "customIcon"
3435
},
@@ -58,6 +59,7 @@ test.ifMac("no Applications link", () => {
5859
return assertPack("test-app-one", {
5960
targets: Platform.MAC.createTarget(),
6061
config: {
62+
publish: null,
6163
productName: "NoApplicationsLink",
6264
dmg: {
6365
"contents": [
@@ -131,6 +133,7 @@ test.ifAll.ifMac("disable dmg icon (light), bundleVersion", () => {
131133
return assertPack("test-app-one", {
132134
targets: Platform.MAC.createTarget(),
133135
config: {
136+
publish: null,
134137
dmg: {
135138
icon: null,
136139
},

test/src/nsisUpdaterTest.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ g.__test_app = {
2121
return "0.0.1"
2222
},
2323

24+
getAppPath: function () {
25+
},
26+
2427
on: function () {
2528
// ignored
2629
},

yarn.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ ajv@^4.9.1:
121121
json-stable-stringify "^1.0.1"
122122

123123
ajv@^5.0.4-beta.2:
124-
version "5.0.4-beta.2"
125-
resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.0.4-beta.2.tgz#2b1dbc09cbd69ee0797489894ab38d12c914e121"
124+
version "5.0.4-beta.3"
125+
resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.0.4-beta.3.tgz#bb87e35a8f04787a3b7e9b7b2756a6acb6ac926c"
126126
dependencies:
127127
co "^4.6.0"
128128
json-stable-stringify "^1.0.1"
@@ -1288,8 +1288,8 @@ forever-agent@~0.6.1:
12881288
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
12891289

12901290
form-data@~2.1.1:
1291-
version "2.1.2"
1292-
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.2.tgz#89c3534008b97eada4cbb157d58f6f5df025eae4"
1291+
version "2.1.4"
1292+
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1"
12931293
dependencies:
12941294
asynckit "^0.4.0"
12951295
combined-stream "^1.0.5"
@@ -2655,8 +2655,8 @@ readable-stream@^1.1.8, readable-stream@~1.1.9:
26552655
string_decoder "~0.10.x"
26562656

26572657
readable-stream@^2.0.0, readable-stream@^2.0.5:
2658-
version "2.2.8"
2659-
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.8.tgz#ad28b686f3554c73d39bc32347fa058356624705"
2658+
version "2.2.9"
2659+
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.9.tgz#cf78ec6f4a6d1eb43d26488cac97f042e74b7fc8"
26602660
dependencies:
26612661
buffer-shims "~1.0.0"
26622662
core-util-is "~1.0.0"
@@ -3247,8 +3247,8 @@ typical@^2.4.2, typical@^2.6.0:
32473247
resolved "https://registry.yarnpkg.com/typical/-/typical-2.6.0.tgz#89d51554ab139848a65bcc2c8772f8fb450c40ed"
32483248

32493249
uglify-js@^2.6:
3250-
version "2.8.21"
3251-
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.21.tgz#1733f669ae6f82fc90c7b25ec0f5c783ee375314"
3250+
version "2.8.22"
3251+
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.22.tgz#d54934778a8da14903fa29a326fb24c0ab51a1a0"
32523252
dependencies:
32533253
source-map "~0.5.1"
32543254
yargs "~3.10.0"

0 commit comments

Comments
 (0)