electron-version-deployer-cli 0.0.13 → 0.0.15
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 +11 -1
- package/dist/main.js +20 -5
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -266,6 +266,16 @@ async function copySourceAndZipFiles(configs) {
|
|
|
266
266
|
]);
|
|
267
267
|
await archiveFiles(logicCodeZipPath, [codesPath, packageJSONPath]);
|
|
268
268
|
node_fs.copyFileSync(packageJSONPath, r("node_modules/.evd/package.json"));
|
|
269
|
+
node_fs.writeFileSync(
|
|
270
|
+
r("node_modules/.evd/netlify.toml"),
|
|
271
|
+
`[[headers]]
|
|
272
|
+
for = "/*"
|
|
273
|
+
[headers.values]
|
|
274
|
+
Access-Control-Allow-Origin = "*"
|
|
275
|
+
Access-Control-Allow-Methods = "*"
|
|
276
|
+
Access-Control-Allow-Headers = "*"`,
|
|
277
|
+
"utf-8"
|
|
278
|
+
);
|
|
269
279
|
console.log(logSymbols.success, "更新包创建成功!");
|
|
270
280
|
}
|
|
271
281
|
async function genChangelog(configs) {
|
|
@@ -497,4 +507,4 @@ async function installPrebuilt(configs) {
|
|
|
497
507
|
}
|
|
498
508
|
commander.program.description(
|
|
499
509
|
"Electron 版本部署 CLI,简化你的 Electron 软件更新,让一切变得简单。"
|
|
500
|
-
).helpOption("-h, --help", "使用帮助").version("0.0.
|
|
510
|
+
).helpOption("-h, --help", "使用帮助").version("0.0.15", "-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() {
|