electron-version-deployer-cli 0.0.9 → 0.0.10
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 +1 -1
- package/dist/main.d.ts +2 -1
- package/dist/main.js +10 -5
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -495,4 +495,4 @@ async function installPrebuilt(configs) {
|
|
|
495
495
|
}
|
|
496
496
|
commander.program.description(
|
|
497
497
|
"Electron 版本部署 CLI,简化你的 Electron 软件更新,让一切变得简单。"
|
|
498
|
-
).helpOption("-h, --help", "使用帮助").version("0.0.
|
|
498
|
+
).helpOption("-h, --help", "使用帮助").version("0.0.10", "-V, --version", "显示版本号").parse(process.argv);
|
package/dist/main.d.ts
CHANGED
|
@@ -11,8 +11,9 @@ type EVDInitPropsType = {
|
|
|
11
11
|
windowHeight?: number;
|
|
12
12
|
logo?: string;
|
|
13
13
|
detectionFrequency?: number;
|
|
14
|
-
detectAtStart?:
|
|
14
|
+
detectAtStart?: boolean;
|
|
15
15
|
onError?: (err: unknown) => void;
|
|
16
|
+
onBeforeNewPkgInstall?: (next: () => any) => void;
|
|
16
17
|
};
|
|
17
18
|
export declare function EVDInit(props: EVDInitPropsType): void;
|
|
18
19
|
export declare function EVDCheckUpdate(): Promise<boolean>;
|
package/dist/main.js
CHANGED
|
@@ -213,7 +213,7 @@ async function installPkg(zipFile) {
|
|
|
213
213
|
await new Promise((res) => setTimeout(res, 1e3));
|
|
214
214
|
}
|
|
215
215
|
function bindEvent(promptWindow) {
|
|
216
|
-
const { logo } = getConfigs();
|
|
216
|
+
const { logo, onBeforeNewPkgInstall } = getConfigs();
|
|
217
217
|
electron.ipcMain.on("evd-open-link", (_, link) => {
|
|
218
218
|
electron.shell.openExternal(link);
|
|
219
219
|
});
|
|
@@ -221,10 +221,12 @@ function bindEvent(promptWindow) {
|
|
|
221
221
|
promptWindow.close();
|
|
222
222
|
});
|
|
223
223
|
electron.ipcMain.on("evd-update-now", (_) => {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
224
|
+
onBeforeNewPkgInstall(() => {
|
|
225
|
+
installNewVersion().then(() => {
|
|
226
|
+
promptWindow.close();
|
|
227
|
+
electron.app.relaunch();
|
|
228
|
+
electron.app.exit();
|
|
229
|
+
});
|
|
228
230
|
});
|
|
229
231
|
});
|
|
230
232
|
electron.ipcMain.handle("evd-get-logo", () => {
|
|
@@ -268,6 +270,9 @@ function getConfigs() {
|
|
|
268
270
|
...{
|
|
269
271
|
onError: () => {
|
|
270
272
|
},
|
|
273
|
+
onBeforeNewPkgInstall: (next) => {
|
|
274
|
+
next();
|
|
275
|
+
},
|
|
271
276
|
windowHeight: 360,
|
|
272
277
|
windowWidth: 400,
|
|
273
278
|
logo: void 0,
|