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