electron-version-deployer-cli 0.0.17 → 0.0.18

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/dist/cli.cjs CHANGED
@@ -507,4 +507,4 @@ async function installPrebuilt(configs) {
507
507
  }
508
508
  commander.program.description(
509
509
  "Electron 版本部署 CLI,简化你的 Electron 软件更新,让一切变得简单。"
510
- ).helpOption("-h, --help", "使用帮助").version("0.0.17", "-V, --version", "显示版本号").parse(process.argv);
510
+ ).helpOption("-h, --help", "使用帮助").version("0.0.18", "-V, --version", "显示版本号").parse(process.argv);
package/dist/main.js CHANGED
@@ -177,7 +177,7 @@ async function showNewVersionDialog() {
177
177
  promptWindow.once("close", () => {
178
178
  cleanup(promptWindow);
179
179
  });
180
- bindEvent(promptWindow);
180
+ bindEvent(promptWindow, onError);
181
181
  } catch (e) {
182
182
  onError(e);
183
183
  }
@@ -249,7 +249,7 @@ async function installPkg(zipFile) {
249
249
  new Promise((res) => setTimeout(res, 5 * 60 * 1e3))
250
250
  ]);
251
251
  }
252
- function bindEvent(promptWindow) {
252
+ function bindEvent(promptWindow, onError) {
253
253
  const { logo, onBeforeNewPkgInstall } = getConfigs();
254
254
  electron.ipcMain.on("evd-open-link", (_, link) => {
255
255
  electron.shell.openExternal(link);
@@ -260,9 +260,11 @@ function bindEvent(promptWindow) {
260
260
  electron.ipcMain.on("evd-update-now", (_) => {
261
261
  onBeforeNewPkgInstall(() => {
262
262
  installNewVersion().then(() => {
263
- promptWindow.close();
264
- electron.app.relaunch();
265
- electron.app.exit();
263
+ setTimeout(() => promptWindow.close(), 1);
264
+ setTimeout(() => electron.app.relaunch(), 1);
265
+ setTimeout(() => electron.app.exit(), 1);
266
+ }).catch((e) => {
267
+ onError(e);
266
268
  });
267
269
  });
268
270
  });
@@ -297,9 +299,7 @@ function cleanup(promptWindow) {
297
299
  );
298
300
  try {
299
301
  promptWindow == null ? void 0 : promptWindow.focus();
300
- if (promptWindow) {
301
- promptWindow.destroy();
302
- }
302
+ promptWindow == null ? void 0 : promptWindow.destroy();
303
303
  } catch (e) {
304
304
  }
305
305
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "electron-version-deployer-cli",
3
3
  "private": false,
4
- "version": "0.0.17",
4
+ "version": "0.0.18",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.cjs.js",
7
7
  "module": "./dist/index.es.js",