electron-updator 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -6
- package/build/app-updator.js +39 -36
- package/build/common/constants.js +23 -1
- package/build/index.js +7 -2
- package/build/mac-updator.js +1 -4
- package/build/utils/index.js +1 -1
- package/build/utils/install-macos-dmg.js +4 -0
- package/build/utils/sudo-prompt-exec.js +1 -1
- package/build/windows-updator.js +2 -2
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
[![NPM version][npm-image]][npm-url]
|
|
4
4
|
[![CI][ci-image]][ci-url]
|
|
5
|
-
[![Test coverage][codecov-image]][codecov-url]
|
|
6
5
|
[![node version][node-image]][node-url]
|
|
7
6
|
[![npm download][download-image]][download-url]
|
|
8
7
|
|
|
@@ -10,8 +9,6 @@
|
|
|
10
9
|
[npm-url]: https://npmjs.org/package/electron-updator
|
|
11
10
|
[ci-image]: https://github.com/electron-modules/electron-updator/actions/workflows/ci.yml/badge.svg
|
|
12
11
|
[ci-url]: https://github.com/electron-modules/electron-updator/actions/workflows/ci.yml
|
|
13
|
-
[codecov-image]: https://img.shields.io/codecov/c/github/electron-modules/electron-updator.svg?logo=codecov
|
|
14
|
-
[codecov-url]: https://codecov.io/gh/electron-modules/electron-updator
|
|
15
12
|
[node-image]: https://img.shields.io/badge/node.js-%3E=_16-green.svg
|
|
16
13
|
[node-url]: http://nodejs.org/download/
|
|
17
14
|
[download-image]: https://img.shields.io/npm/dm/electron-updator.svg
|
|
@@ -28,11 +25,11 @@ $ npm i electron-updator --save
|
|
|
28
25
|
|
|
29
26
|
## Contributors
|
|
30
27
|
|
|
31
|
-
|[<img src="https://avatars.githubusercontent.com/u/1011681?v=4" width="100px;"/><br/><sub><b>xudafeng</b></sub>](https://github.com/xudafeng)<br/>|[<img src="https://avatars.githubusercontent.com/u/
|
|
32
|
-
| :---: | :---: |
|
|
28
|
+
|[<img src="https://avatars.githubusercontent.com/u/4081746?v=4" width="100px;"/><br/><sub><b>zlyi</b></sub>](https://github.com/zlyi)<br/>|[<img src="https://avatars.githubusercontent.com/u/1011681?v=4" width="100px;"/><br/><sub><b>xudafeng</b></sub>](https://github.com/xudafeng)<br/>|[<img src="https://avatars.githubusercontent.com/u/52845048?v=4" width="100px;"/><br/><sub><b>snapre</b></sub>](https://github.com/snapre)<br/>|
|
|
29
|
+
| :---: | :---: | :---: |
|
|
33
30
|
|
|
34
31
|
|
|
35
|
-
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `
|
|
32
|
+
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Tue Jan 31 2023 14:31:40 GMT+0800`.
|
|
36
33
|
|
|
37
34
|
<!-- GITCONTRIBUTOR_END -->
|
|
38
35
|
|
package/build/app-updator.js
CHANGED
|
@@ -9,12 +9,12 @@ const elelctron_app_adapter_1 = require("./elelctron-app-adapter");
|
|
|
9
9
|
class AppUpdator extends eventemitter3_1.EventEmitter {
|
|
10
10
|
constructor(options, app) {
|
|
11
11
|
super();
|
|
12
|
-
this.state =
|
|
12
|
+
this.state = constants_1.StateType.Idle;
|
|
13
13
|
this.options = options;
|
|
14
14
|
this.logger = this._wrapLogger(options.logger);
|
|
15
15
|
this.app = app || new elelctron_app_adapter_1.ElectronAppAdapter();
|
|
16
16
|
this.startTimeStamp = new Date().getTime();
|
|
17
|
-
this.logger.info('
|
|
17
|
+
this.logger.info('ElectronUpdator#constructor');
|
|
18
18
|
this.availableUpdate = {
|
|
19
19
|
resourcePath: '',
|
|
20
20
|
latestAsarPath: '',
|
|
@@ -41,22 +41,22 @@ class AppUpdator extends eventemitter3_1.EventEmitter {
|
|
|
41
41
|
return _logger;
|
|
42
42
|
}
|
|
43
43
|
setState(state) {
|
|
44
|
-
this.logger.info(`
|
|
44
|
+
this.logger.info(`ElectronUpdator#setState${state}`);
|
|
45
45
|
this.state = state;
|
|
46
46
|
}
|
|
47
47
|
setFeedUrl(url) {
|
|
48
|
-
this.logger.info(`
|
|
48
|
+
this.logger.info(`ElectronUpdator#setFeedUrl:url is ${url}`);
|
|
49
49
|
if (url && this.options) {
|
|
50
50
|
this.options.url = url;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
async checkForUpdates(executeType = constants_1.ExecuteType.Auto) {
|
|
54
|
-
this.logger.info(`
|
|
55
|
-
this.setState(
|
|
54
|
+
this.logger.info(`ElectronUpdator#checkForUpdates:state is ${this.state}`);
|
|
55
|
+
this.setState(constants_1.StateType.Idle);
|
|
56
56
|
try {
|
|
57
57
|
// 新一轮更新流程,更新 TimeStamp
|
|
58
58
|
this.startTimeStamp = new Date().getTime();
|
|
59
|
-
this.setState(
|
|
59
|
+
this.setState(constants_1.StateType.CheckingForUpdate);
|
|
60
60
|
this.emit(constants_1.EventType.CHECKING_FOR_UPDATE);
|
|
61
61
|
const updateInfoResponse = await (0, utils_1.requestUpdateInfo)(this.options);
|
|
62
62
|
this.updateInfo = (this.options?.responseFormatter ? this.options?.responseFormatter(updateInfoResponse) : updateInfoResponse);
|
|
@@ -67,13 +67,13 @@ class AppUpdator extends eventemitter3_1.EventEmitter {
|
|
|
67
67
|
updateInfo: this.updateInfo,
|
|
68
68
|
executeType,
|
|
69
69
|
});
|
|
70
|
-
this.setState(
|
|
70
|
+
this.setState(constants_1.StateType.Idle);
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
this.logger.info('
|
|
73
|
+
this.logger.info('ElectronUpdator#checkForUpdates:needUpdate is true');
|
|
74
74
|
this.availableUpdate = this.doGetAvailableUpdateInfo(this.updateInfo);
|
|
75
75
|
if (!this.options?.autoDownload || executeType === constants_1.ExecuteType.User) {
|
|
76
|
-
this.logger.info('
|
|
76
|
+
this.logger.info('ElectronUpdator#checkForUpdates:emit UPDATE_AVAILABLE');
|
|
77
77
|
this.emit(constants_1.EventType.UPDATE_AVAILABLE, {
|
|
78
78
|
updateInfo: this.updateInfo,
|
|
79
79
|
executeType,
|
|
@@ -85,31 +85,31 @@ class AppUpdator extends eventemitter3_1.EventEmitter {
|
|
|
85
85
|
catch (e) {
|
|
86
86
|
e.customMessage = e.customMessage ? e.customMessage : `${constants_1.InstallResultType.CheckForUpdatesError}_${e.message}`;
|
|
87
87
|
this.logError(e);
|
|
88
|
-
this.setState(
|
|
88
|
+
this.setState(constants_1.StateType.Idle);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
async downloadUpdate(executeType = constants_1.ExecuteType.User) {
|
|
92
|
-
this.logger.info(`
|
|
93
|
-
await this.downloadUpdateFile(this.updateInfo);
|
|
94
|
-
const result = await this.preCheck();
|
|
92
|
+
this.logger.info(`ElectronUpdator#downloadUpdate:executeType is ${executeType}`);
|
|
93
|
+
await this.downloadUpdateFile(this.updateInfo, executeType);
|
|
94
|
+
const result = await this.preCheck(executeType);
|
|
95
95
|
if (result.success) {
|
|
96
|
-
this.logger.info('
|
|
96
|
+
this.logger.info('ElectronUpdator#downloadUpdate:emit UPDATE_DOWNLOADED');
|
|
97
97
|
this.emit(constants_1.EventType.UPDATE_DOWNLOADED, {
|
|
98
98
|
executeType,
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
else {
|
|
102
102
|
this.logError(result.error);
|
|
103
|
-
this.setState(
|
|
103
|
+
this.setState(constants_1.StateType.Idle);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
async quitAndInstall() {
|
|
107
|
-
this.logger.info(`
|
|
108
|
-
if (this.state !==
|
|
107
|
+
this.logger.info(`ElectronUpdator#quitAndInstall:state is ${this.state}`);
|
|
108
|
+
if (this.state !== constants_1.StateType.Downloaded) {
|
|
109
109
|
this.downloadUpdate();
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
|
-
this.setState(
|
|
112
|
+
this.setState(constants_1.StateType.Idle);
|
|
113
113
|
try {
|
|
114
114
|
let result = { success: false };
|
|
115
115
|
if (this.updateInfo?.updateType === constants_1.UpdateType.Package) {
|
|
@@ -119,7 +119,7 @@ class AppUpdator extends eventemitter3_1.EventEmitter {
|
|
|
119
119
|
result = await this.doQuitAndInstallAsar();
|
|
120
120
|
}
|
|
121
121
|
if (result.success) {
|
|
122
|
-
this.logger.warn('
|
|
122
|
+
this.logger.warn('ElectronUpdator#quitAndInstall:install success');
|
|
123
123
|
this.emit(constants_1.EventType.BEFORE_QUIT_FOR_UPDATE);
|
|
124
124
|
}
|
|
125
125
|
else {
|
|
@@ -132,21 +132,21 @@ class AppUpdator extends eventemitter3_1.EventEmitter {
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
async preCheckForAsar() {
|
|
135
|
-
this.logger.info('
|
|
135
|
+
this.logger.info('ElectronUpdator#preCheckForAsar');
|
|
136
136
|
return await this.unzip();
|
|
137
137
|
}
|
|
138
|
-
async preCheck() {
|
|
139
|
-
this.logger.info('
|
|
138
|
+
async preCheck(executeType) {
|
|
139
|
+
this.logger.info('ElectronUpdator#preCheck');
|
|
140
140
|
const { resourcePath } = this.availableUpdate;
|
|
141
|
-
if (this.state !==
|
|
141
|
+
if (this.state !== constants_1.StateType.Downloaded) {
|
|
142
142
|
return {
|
|
143
143
|
success: false,
|
|
144
|
-
error: new Error(`
|
|
144
|
+
error: new Error(`ElectronUpdator#preCheck:update status(${this.state}) error`),
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
147
|
// 清理老包
|
|
148
148
|
try {
|
|
149
|
-
this.logger.info('
|
|
149
|
+
this.logger.info('ElectronUpdator#preCheck:cleanOldArchive');
|
|
150
150
|
await (0, utils_1.cleanOldArchive)(resourcePath);
|
|
151
151
|
}
|
|
152
152
|
catch (e) {
|
|
@@ -171,20 +171,23 @@ class AppUpdator extends eventemitter3_1.EventEmitter {
|
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
173
|
if (this.updateInfo?.updateType === constants_1.UpdateType.Package) {
|
|
174
|
-
|
|
174
|
+
if (executeType === constants_1.ExecuteType.Auto) {
|
|
175
|
+
// 自动安装时,才进行预检查,提升安装效率
|
|
176
|
+
result = await this.doPreCheckForPackage();
|
|
177
|
+
}
|
|
175
178
|
}
|
|
176
179
|
else {
|
|
177
180
|
result = await this.preCheckForAsar();
|
|
178
181
|
}
|
|
179
182
|
return result;
|
|
180
183
|
}
|
|
181
|
-
async downloadUpdateFile(updateInfo) {
|
|
182
|
-
if (this.state !==
|
|
183
|
-
throw new Error(`
|
|
184
|
+
async downloadUpdateFile(updateInfo, executeType) {
|
|
185
|
+
if (this.state !== constants_1.StateType.CheckingForUpdate) {
|
|
186
|
+
throw new Error(`ElectronUpdator#downloadUpdateFile:update status(${this.state}) error`);
|
|
184
187
|
}
|
|
185
188
|
const { url, signature } = updateInfo.files[0];
|
|
186
189
|
const { downloadTargetDir } = this.availableUpdate;
|
|
187
|
-
this.setState(
|
|
190
|
+
this.setState(constants_1.StateType.Downloading);
|
|
188
191
|
try {
|
|
189
192
|
await (0, download_file_1.downloadFile)({
|
|
190
193
|
logger: this.logger,
|
|
@@ -193,20 +196,20 @@ class AppUpdator extends eventemitter3_1.EventEmitter {
|
|
|
193
196
|
targetDir: downloadTargetDir,
|
|
194
197
|
emit: this.emit,
|
|
195
198
|
progressHandle: (data) => {
|
|
196
|
-
this.emit(constants_1.EventType.UPDATE_DOWNLOAD_PROGRESS, data);
|
|
199
|
+
this.emit(constants_1.EventType.UPDATE_DOWNLOAD_PROGRESS, { ...data, executeType });
|
|
197
200
|
},
|
|
198
201
|
});
|
|
199
|
-
this.logger.info('
|
|
200
|
-
this.setState(
|
|
202
|
+
this.logger.info('ElectronUpdator#downloadUpdateFile:Downloaded');
|
|
203
|
+
this.setState(constants_1.StateType.Downloaded);
|
|
201
204
|
}
|
|
202
205
|
catch (e) {
|
|
203
|
-
this.setState(
|
|
206
|
+
this.setState(constants_1.StateType.Idle);
|
|
204
207
|
e.customMessage = `${constants_1.InstallResultType.DownloadError}_${e.message}`;
|
|
205
208
|
this.logError(e);
|
|
206
209
|
}
|
|
207
210
|
}
|
|
208
211
|
async unzip() {
|
|
209
|
-
this.logger.info('
|
|
212
|
+
this.logger.info('ElectronUpdator#unzip:start');
|
|
210
213
|
try {
|
|
211
214
|
const result = await this.doUnzip();
|
|
212
215
|
if (!result.success) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EventType = exports.DownloadProgressStatus = exports.ExecuteType = exports.UpdateType = exports.InstallResultType = exports.OldArchivePrefix = void 0;
|
|
3
|
+
exports.EventType = exports.DownloadProgressStatus = exports.ExecuteType = exports.UpdateType = exports.StateType = exports.InstallResultType = exports.OldArchivePrefix = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* 更新包备份前缀
|
|
6
6
|
*/
|
|
@@ -15,6 +15,28 @@ var InstallResultType;
|
|
|
15
15
|
InstallResultType["UpdateSuccess"] = "update-success";
|
|
16
16
|
InstallResultType["CheckForUpdatesError"] = "check-for-updates-error";
|
|
17
17
|
})(InstallResultType = exports.InstallResultType || (exports.InstallResultType = {}));
|
|
18
|
+
/**
|
|
19
|
+
* 更新状态
|
|
20
|
+
*/
|
|
21
|
+
var StateType;
|
|
22
|
+
(function (StateType) {
|
|
23
|
+
/**
|
|
24
|
+
* 空闲
|
|
25
|
+
*/
|
|
26
|
+
StateType["Idle"] = "idle";
|
|
27
|
+
/**
|
|
28
|
+
* 检查更新中
|
|
29
|
+
*/
|
|
30
|
+
StateType["CheckingForUpdate"] = "checking-for-update";
|
|
31
|
+
/**
|
|
32
|
+
* 下载中
|
|
33
|
+
*/
|
|
34
|
+
StateType["Downloading"] = "downloading";
|
|
35
|
+
/**
|
|
36
|
+
* 下载完成
|
|
37
|
+
*/
|
|
38
|
+
StateType["Downloaded"] = "downloaded";
|
|
39
|
+
})(StateType = exports.StateType || (exports.StateType = {}));
|
|
18
40
|
/**
|
|
19
41
|
* 更新类型
|
|
20
42
|
*/
|
package/build/index.js
CHANGED
|
@@ -4,7 +4,12 @@ const constants_1 = require("./common/constants");
|
|
|
4
4
|
const mac_updator_1 = require("./mac-updator");
|
|
5
5
|
const windows_updator_1 = require("./windows-updator");
|
|
6
6
|
exports.default = {
|
|
7
|
-
UpdateType: constants_1.UpdateType,
|
|
8
|
-
|
|
7
|
+
UpdateType: constants_1.UpdateType,
|
|
8
|
+
EventType: constants_1.EventType,
|
|
9
|
+
ExecuteType: constants_1.ExecuteType,
|
|
10
|
+
StateType: constants_1.StateType,
|
|
11
|
+
MacUpdator: mac_updator_1.MacUpdator,
|
|
12
|
+
WindowsUpdator: windows_updator_1.WindowsUpdator,
|
|
13
|
+
DownloadProgressStatus: constants_1.DownloadProgressStatus,
|
|
9
14
|
};
|
|
10
15
|
//# sourceMappingURL=index.js.map
|
package/build/mac-updator.js
CHANGED
|
@@ -10,9 +10,6 @@ const constants_1 = require("./common/constants");
|
|
|
10
10
|
const install_macos_dmg_1 = __importDefault(require("./utils/install-macos-dmg"));
|
|
11
11
|
const utils_1 = require("./utils");
|
|
12
12
|
class MacUpdator extends app_updator_1.AppUpdator {
|
|
13
|
-
constructor(options) {
|
|
14
|
-
super(options);
|
|
15
|
-
}
|
|
16
13
|
doGetAvailableUpdateInfo(updateInfo) {
|
|
17
14
|
this.logger.info('MacUpdator#doGetAvailableUpdateInfo:start');
|
|
18
15
|
const exePath = this.app.exePath;
|
|
@@ -96,7 +93,7 @@ class MacUpdator extends app_updator_1.AppUpdator {
|
|
|
96
93
|
};
|
|
97
94
|
}
|
|
98
95
|
async doQuitAndInstallPackage() {
|
|
99
|
-
this.logger.info('
|
|
96
|
+
this.logger.info('ElectronUpdator#doQuitAndInstallPackage:start');
|
|
100
97
|
return await (0, install_macos_dmg_1.default)(this.options, this.logger, this.availableUpdate, this.updateInfo);
|
|
101
98
|
}
|
|
102
99
|
}
|
package/build/utils/index.js
CHANGED
|
@@ -5,12 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getExecuteFile = exports.requestUpdateInfo = exports.existFile = exports.cleanOldArchive = exports.spawnAsync = exports.waitUntil = exports.sleep = exports.getMacOSAppPath = exports.sudoPrompt = exports.existsSync = exports.createWriteStream = exports.isMac = exports.isWin = exports.execAsync = exports.rimrafAsync = exports.readdirAsync = exports.existsAsync = exports.renameAsync = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const child_process_1 = require("child_process");
|
|
9
8
|
const util_1 = __importDefault(require("util"));
|
|
10
9
|
const urllib_1 = __importDefault(require("urllib"));
|
|
11
10
|
const sudo_prompt_alt_1 = __importDefault(require("sudo-prompt-alt"));
|
|
12
11
|
exports.sudoPrompt = sudo_prompt_alt_1.default;
|
|
13
12
|
const rimraf_alt_1 = __importDefault(require("rimraf-alt"));
|
|
13
|
+
const child_process_1 = require("child_process");
|
|
14
14
|
const original_fs_1 = require("original-fs");
|
|
15
15
|
Object.defineProperty(exports, "existsSync", { enumerable: true, get: function () { return original_fs_1.existsSync; } });
|
|
16
16
|
Object.defineProperty(exports, "createWriteStream", { enumerable: true, get: function () { return original_fs_1.createWriteStream; } });
|
|
@@ -51,6 +51,7 @@ exports.default = async (updatorOptions, logger, availableUpdate, updateInfo, pr
|
|
|
51
51
|
if (preCheck) {
|
|
52
52
|
_log(logger, error);
|
|
53
53
|
}
|
|
54
|
+
// eslint-disable-next-line
|
|
54
55
|
return {
|
|
55
56
|
success: false,
|
|
56
57
|
error,
|
|
@@ -75,6 +76,7 @@ exports.default = async (updatorOptions, logger, availableUpdate, updateInfo, pr
|
|
|
75
76
|
if (preCheck) {
|
|
76
77
|
_log(logger, error);
|
|
77
78
|
}
|
|
79
|
+
// eslint-disable-next-line
|
|
78
80
|
return {
|
|
79
81
|
success: false,
|
|
80
82
|
error,
|
|
@@ -109,6 +111,7 @@ exports.default = async (updatorOptions, logger, availableUpdate, updateInfo, pr
|
|
|
109
111
|
});
|
|
110
112
|
if (!tmpPathExist) {
|
|
111
113
|
const error = new Error('cp to tmp path fail');
|
|
114
|
+
// eslint-disable-next-line
|
|
112
115
|
return {
|
|
113
116
|
success: false,
|
|
114
117
|
error,
|
|
@@ -131,6 +134,7 @@ exports.default = async (updatorOptions, logger, availableUpdate, updateInfo, pr
|
|
|
131
134
|
if (!appExist) {
|
|
132
135
|
const error = new Error('cp to app fail');
|
|
133
136
|
await (0, index_1.spawnAsync)('mv', [tmpPath, appPath]);
|
|
137
|
+
// eslint-disable-next-line
|
|
134
138
|
return {
|
|
135
139
|
success: false,
|
|
136
140
|
error,
|
|
@@ -8,7 +8,7 @@ function sudoPromptExec(appUpdatorOptions, logger, shell) {
|
|
|
8
8
|
};
|
|
9
9
|
return new Promise((resolve, reject) => {
|
|
10
10
|
logger.warn(`update#sudoPromptExec_shell_${shell}`);
|
|
11
|
-
index_1.sudoPrompt.exec(shell, options, (error, stdout
|
|
11
|
+
index_1.sudoPrompt.exec(shell, options, (error, stdout) => {
|
|
12
12
|
if (error) {
|
|
13
13
|
reject(error);
|
|
14
14
|
logger.error(`update#sudoPromptExec_error_${error}`);
|
package/build/windows-updator.js
CHANGED
|
@@ -13,7 +13,7 @@ const utils_1 = require("./utils");
|
|
|
13
13
|
class WindowsUpdator extends app_updator_1.AppUpdator {
|
|
14
14
|
doGetAvailableUpdateInfo(updateInfo) {
|
|
15
15
|
this.logger.info('WindowsUpdator#doGetAvailableUpdateInfo:start');
|
|
16
|
-
|
|
16
|
+
const resourcePath = path_1.default.resolve(this.app.userDataPath);
|
|
17
17
|
const latestAsarPath = path_1.default.resolve(resourcePath, 'latest.asar');
|
|
18
18
|
const latestAppPath = path_1.default.resolve(resourcePath, 'latest');
|
|
19
19
|
let downloadTargetDir = `${latestAsarPath}.zip`;
|
|
@@ -76,7 +76,7 @@ class WindowsUpdator extends app_updator_1.AppUpdator {
|
|
|
76
76
|
const executeCommand = `"${updateExePath}" "${targetPath}" "${resourcePath}" "${productName}.exe" "${exePath}"`;
|
|
77
77
|
try {
|
|
78
78
|
await (0, sudo_prompt_exec_1.sudoPromptExec)(this.options, this.logger, executeCommand);
|
|
79
|
-
this.logger.warn('
|
|
79
|
+
this.logger.warn('ElectronUpdator#quitAndInstall:install success');
|
|
80
80
|
this.emit(constants_1.EventType.BEFORE_QUIT_FOR_UPDATE);
|
|
81
81
|
return Promise.resolve({ success: true });
|
|
82
82
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "electron-updator",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "electron-updator is a software updator management solution for Electron applications, It is convenient to complete full software update and dynamic update.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "sh ./build.sh",
|
|
7
7
|
"test": "egg-bin test test/**/index.test.ts",
|
|
8
|
-
"lint": "eslint --fix --quiet --ext .js,.
|
|
8
|
+
"lint": "eslint --fix --quiet --ext .js,.ts ./src",
|
|
9
9
|
"prepublishOnly": "npm run build",
|
|
10
10
|
"contributor": "git-contributor",
|
|
11
11
|
"dev": "ttsc -p tsconfig.json -watch"
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"eventemitter3": "^4.0.0",
|
|
29
|
-
"lodash": "4
|
|
30
|
-
"moment": "2
|
|
29
|
+
"lodash": "4",
|
|
30
|
+
"moment": "2",
|
|
31
31
|
"rimraf-alt": "*",
|
|
32
32
|
"sudo-prompt-alt": "9",
|
|
33
|
-
"urllib": "2
|
|
33
|
+
"urllib": "2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@applint/spec": "^1.2.0",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"electron": "18",
|
|
49
49
|
"electron-windows": "18",
|
|
50
50
|
"eslint": "^7.32.0",
|
|
51
|
-
"eslint-config-egg": "^
|
|
52
|
-
"eslint-plugin-no-only-tests": "^
|
|
51
|
+
"eslint-config-egg": "^12.1.0",
|
|
52
|
+
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
53
53
|
"git-contributor": "*",
|
|
54
54
|
"husky": "^7.0.4",
|
|
55
55
|
"mm": "^3.0.2",
|
|
@@ -69,4 +69,4 @@
|
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
71
|
"license": "MIT"
|
|
72
|
-
}
|
|
72
|
+
}
|