electron-version-deployer-cli 0.0.12 → 0.0.14
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 +4 -2
- package/dist/main.js +20 -5
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -15,6 +15,7 @@ const jsdom = require("jsdom");
|
|
|
15
15
|
const DOMPurify = require("dompurify");
|
|
16
16
|
const archiver = require("archiver");
|
|
17
17
|
const node_https = require("node:https");
|
|
18
|
+
const node_os = require("node:os");
|
|
18
19
|
const download = require("download");
|
|
19
20
|
const pkgPath = pkgUp.sync();
|
|
20
21
|
function r(...paths) {
|
|
@@ -382,7 +383,8 @@ commander.program.command("deploy").description("执行部署").action(async (so
|
|
|
382
383
|
});
|
|
383
384
|
async function deploy(configs) {
|
|
384
385
|
console.log(logSymbols.info, "开始部署", r());
|
|
385
|
-
const
|
|
386
|
+
const cmd = node_os.platform() === "win32" ? "netlify.cmd" : "netlify";
|
|
387
|
+
const output = node_child_process.spawn(cmd, [
|
|
386
388
|
"deploy",
|
|
387
389
|
"--dir",
|
|
388
390
|
r("node_modules/.evd"),
|
|
@@ -495,4 +497,4 @@ async function installPrebuilt(configs) {
|
|
|
495
497
|
}
|
|
496
498
|
commander.program.description(
|
|
497
499
|
"Electron 版本部署 CLI,简化你的 Electron 软件更新,让一切变得简单。"
|
|
498
|
-
).helpOption("-h, --help", "使用帮助").version("0.0.
|
|
500
|
+
).helpOption("-h, --help", "使用帮助").version("0.0.14", "-V, --version", "显示版本号").parse(process.argv);
|
package/dist/main.js
CHANGED
|
@@ -7,6 +7,7 @@ const node_https = require("node:https");
|
|
|
7
7
|
const node_fs = require("node:fs");
|
|
8
8
|
const extract = require("extract-zip");
|
|
9
9
|
const node_child_process = require("node:child_process");
|
|
10
|
+
const node_process = require("node:process");
|
|
10
11
|
function fetchRemoteChangelogJSON(remote_url) {
|
|
11
12
|
return new Promise((res, rej) => {
|
|
12
13
|
node_https.get(`${remote_url}/changelog.json`, (_res) => {
|
|
@@ -131,11 +132,12 @@ async function showNewVersionDialog() {
|
|
|
131
132
|
minWidth: windowWidth,
|
|
132
133
|
minHeight: windowHeight,
|
|
133
134
|
resizable: false,
|
|
134
|
-
minimizable:
|
|
135
|
+
minimizable: false,
|
|
135
136
|
fullscreenable: false,
|
|
136
137
|
maximizable: false,
|
|
137
138
|
skipTaskbar: true,
|
|
138
|
-
|
|
139
|
+
// windows 11 如果设置为 true 会导致点击后马上消失
|
|
140
|
+
alwaysOnTop: node_process.platform !== "win32",
|
|
139
141
|
useContentSize: false,
|
|
140
142
|
title: "有可用的更新",
|
|
141
143
|
webPreferences: {
|
|
@@ -162,6 +164,16 @@ async function showNewVersionDialog() {
|
|
|
162
164
|
promptWindow.loadURL(promptUrl);
|
|
163
165
|
promptWindow.once("ready-to-show", () => {
|
|
164
166
|
promptWindow.show();
|
|
167
|
+
setTimeout(() => {
|
|
168
|
+
const allWindows = electron.BrowserWindow.getAllWindows();
|
|
169
|
+
allWindows.forEach((window) => {
|
|
170
|
+
window.on("closed", () => {
|
|
171
|
+
if (electron.BrowserWindow.getAllWindows().length == 1) {
|
|
172
|
+
cleanup(promptWindow);
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
}, 1e3);
|
|
165
177
|
});
|
|
166
178
|
promptWindow.once("close", () => {
|
|
167
179
|
cleanup(promptWindow);
|
|
@@ -280,9 +292,12 @@ function cleanup(promptWindow) {
|
|
|
280
292
|
"evd-get-logo"
|
|
281
293
|
/* GET_LOGO */
|
|
282
294
|
);
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
promptWindow
|
|
295
|
+
try {
|
|
296
|
+
promptWindow == null ? void 0 : promptWindow.focus();
|
|
297
|
+
if (promptWindow) {
|
|
298
|
+
promptWindow.destroy();
|
|
299
|
+
}
|
|
300
|
+
} catch (e) {
|
|
286
301
|
}
|
|
287
302
|
}
|
|
288
303
|
function getConfigs() {
|