ee-bin 4.0.1 → 4.1.0
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/package.json +1 -1
- package/tools/incrUpdater.js +16 -14
package/package.json
CHANGED
package/tools/incrUpdater.js
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
const path = require('path');
|
|
4
4
|
const fs = require('fs');
|
|
5
|
+
const fsPro = require('fs-extra');
|
|
5
6
|
const crypto = require('crypto')
|
|
6
7
|
const chalk = require('chalk');
|
|
7
|
-
const { loadConfig,
|
|
8
|
+
const { loadConfig, getPackage, writeJsonSync } = require('../lib/utils');
|
|
8
9
|
const admZip = require('adm-zip')
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -14,6 +15,16 @@ const admZip = require('adm-zip')
|
|
|
14
15
|
|
|
15
16
|
class IncrUpdater {
|
|
16
17
|
|
|
18
|
+
constructor() {
|
|
19
|
+
this.tmpAppDirs = [
|
|
20
|
+
'mac',
|
|
21
|
+
'mac-arm64',
|
|
22
|
+
'win-unpacked',
|
|
23
|
+
'win-ia32-unpacked',
|
|
24
|
+
'linux-unpacked'
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
|
|
17
28
|
/**
|
|
18
29
|
* 执行
|
|
19
30
|
*/
|
|
@@ -50,14 +61,6 @@ class IncrUpdater {
|
|
|
50
61
|
let asarFilePath = "";
|
|
51
62
|
if (asarFile) {
|
|
52
63
|
asarFilePath = path.normalize(path.join(homeDir, asarFile));
|
|
53
|
-
} else if (Array.isArray(cfg.asarFile)) {
|
|
54
|
-
// 检查文件列表,如果存在就跳出
|
|
55
|
-
for (const filep of cfg.asarFile) {
|
|
56
|
-
asarFilePath = path.normalize(path.join(homeDir, filep));
|
|
57
|
-
if (fs.existsSync(asarFilePath)) {
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
64
|
} else {
|
|
62
65
|
asarFilePath = path.normalize(path.join(homeDir, cfg.asarFile));
|
|
63
66
|
}
|
|
@@ -119,11 +122,10 @@ class IncrUpdater {
|
|
|
119
122
|
|
|
120
123
|
// 删除缓存文件,防止生成的 zip 是旧版本
|
|
121
124
|
if (cfg.cleanCache) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
rm(path.join(homeDir, cfg.output.directory, 'linux-unpacked'));
|
|
125
|
+
this.tmpAppDirs.forEach(dir => {
|
|
126
|
+
const dirPath = path.join(homeDir, cfg.output.directory, dir);
|
|
127
|
+
fsPro.removeSync(dirPath);
|
|
128
|
+
});
|
|
127
129
|
}
|
|
128
130
|
}
|
|
129
131
|
|