@sellerartifact/electron-app-updater 0.0.1 → 0.0.2
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/index.cjs +19 -21
- package/dist/index.js +19 -21
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -125,27 +125,25 @@ function __webpack_require__(moduleId) {
|
|
|
125
125
|
return true;
|
|
126
126
|
}
|
|
127
127
|
async changeVersion(remoteVersion, url) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}, 1200);
|
|
148
|
-
}
|
|
128
|
+
electron.dialog.showMessageBox({
|
|
129
|
+
type: 'info',
|
|
130
|
+
title: '软件升级',
|
|
131
|
+
message: `发现新版本,v${remoteVersion}, 正在下载`,
|
|
132
|
+
buttons: [
|
|
133
|
+
'是的'
|
|
134
|
+
]
|
|
135
|
+
});
|
|
136
|
+
const configPath = this.getConfigPath();
|
|
137
|
+
external_fs_default().writeFileSync(configPath, JSON.stringify({
|
|
138
|
+
version: remoteVersion
|
|
139
|
+
}));
|
|
140
|
+
const writePath = external_path_default().join(this.buildPath, 'build.js');
|
|
141
|
+
const buildResponse = await external_axios_default().get(url);
|
|
142
|
+
external_fs_default().writeFileSync(writePath, buildResponse.data);
|
|
143
|
+
setTimeout(()=>{
|
|
144
|
+
electron.app.relaunch(); // 重启
|
|
145
|
+
electron.app.exit(0);
|
|
146
|
+
}, 1200);
|
|
149
147
|
}
|
|
150
148
|
async getNowVersion() {
|
|
151
149
|
const configPath = this.getConfigPath();
|
package/dist/index.js
CHANGED
|
@@ -70,27 +70,25 @@ class ElectronAppUpdater {
|
|
|
70
70
|
return true;
|
|
71
71
|
}
|
|
72
72
|
async changeVersion(remoteVersion, url) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}, 1200);
|
|
93
|
-
}
|
|
73
|
+
electron.dialog.showMessageBox({
|
|
74
|
+
type: 'info',
|
|
75
|
+
title: '软件升级',
|
|
76
|
+
message: `发现新版本,v${remoteVersion}, 正在下载`,
|
|
77
|
+
buttons: [
|
|
78
|
+
'是的'
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
const configPath = this.getConfigPath();
|
|
82
|
+
external_fs_["default"].writeFileSync(configPath, JSON.stringify({
|
|
83
|
+
version: remoteVersion
|
|
84
|
+
}));
|
|
85
|
+
const writePath = external_path_["default"].join(this.buildPath, 'build.js');
|
|
86
|
+
const buildResponse = await __WEBPACK_EXTERNAL_MODULE_axios__["default"].get(url);
|
|
87
|
+
external_fs_["default"].writeFileSync(writePath, buildResponse.data);
|
|
88
|
+
setTimeout(()=>{
|
|
89
|
+
electron.app.relaunch(); // 重启
|
|
90
|
+
electron.app.exit(0);
|
|
91
|
+
}, 1200);
|
|
94
92
|
}
|
|
95
93
|
async getNowVersion() {
|
|
96
94
|
const configPath = this.getConfigPath();
|