ee-core 1.3.0 → 1.3.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/package.json +1 -1
- package/tools/encrypt.js +7 -3
package/package.json
CHANGED
package/tools/encrypt.js
CHANGED
|
@@ -14,7 +14,7 @@ class Encrypt {
|
|
|
14
14
|
this.basePath = process.cwd();
|
|
15
15
|
this.dirs = [];
|
|
16
16
|
this.encryptCodeDir = path.join(this.basePath, 'public');
|
|
17
|
-
this.config = this.loadConfig('encrypt');
|
|
17
|
+
this.config = this.loadConfig('encrypt.js');
|
|
18
18
|
this.filesExt = this.config.fileExt || ['.js'];
|
|
19
19
|
this.type = this.config.type || 'bytecode';
|
|
20
20
|
const directory = this.config.directory || ['electron'];
|
|
@@ -239,7 +239,10 @@ class Encrypt {
|
|
|
239
239
|
};
|
|
240
240
|
|
|
241
241
|
loadConfig (prop) {
|
|
242
|
-
const filepath = path.join(this.basePath, 'electron', 'config',
|
|
242
|
+
const filepath = path.join(this.basePath, 'electron', 'config', prop);
|
|
243
|
+
if (!fs.existsSync(filepath)) {
|
|
244
|
+
return {};
|
|
245
|
+
}
|
|
243
246
|
const obj = require(filepath);
|
|
244
247
|
if (!obj) return obj;
|
|
245
248
|
|
|
@@ -247,7 +250,8 @@ class Encrypt {
|
|
|
247
250
|
if (is.function(obj) && !is.class(obj)) {
|
|
248
251
|
ret = obj();
|
|
249
252
|
}
|
|
250
|
-
|
|
253
|
+
|
|
254
|
+
return ret || {};
|
|
251
255
|
};
|
|
252
256
|
|
|
253
257
|
md5 (file) {
|