ee-core 2.8.2 → 2.9.0-beta.1
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/cross/spawnProcess.js +9 -0
- package/ee/eeApp.js +4 -1
- package/html/index.js +14 -0
- package/package.json +1 -1
- package/utils/helper.js +7 -0
package/cross/spawnProcess.js
CHANGED
|
@@ -27,7 +27,13 @@ class SpawnProcess {
|
|
|
27
27
|
_init(options = {}) {
|
|
28
28
|
const { targetConf, port } = options;
|
|
29
29
|
this.config = targetConf;
|
|
30
|
+
|
|
30
31
|
this.port = port;
|
|
32
|
+
// 某些程序给它传入不存在的参数时会报错
|
|
33
|
+
if (isNaN(port) && targetConf.port > 0) {
|
|
34
|
+
this.port = targetConf.port;
|
|
35
|
+
}
|
|
36
|
+
|
|
31
37
|
// 该名称如果在childrenMap重复,会被重写
|
|
32
38
|
this.name = targetConf.name;
|
|
33
39
|
|
|
@@ -39,6 +45,9 @@ class SpawnProcess {
|
|
|
39
45
|
if (Ps.isPackaged()) {
|
|
40
46
|
standardOutput = ['ignore', 'ignore', 'ignore', 'ipc'];
|
|
41
47
|
}
|
|
48
|
+
if (targetConf.stdio) {
|
|
49
|
+
standardOutput = targetConf.stdio;
|
|
50
|
+
}
|
|
42
51
|
|
|
43
52
|
const { cmd, directory } = targetConf;
|
|
44
53
|
// use cmd first
|
package/ee/eeApp.js
CHANGED
|
@@ -190,6 +190,9 @@ class EeApp extends BaseApp {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
// 主进程
|
|
193
|
+
if (mainServer.protocol == "") {
|
|
194
|
+
return
|
|
195
|
+
}
|
|
193
196
|
if (Conf.isFileProtocol(mainServer)) {
|
|
194
197
|
url = path.join(this.config.homeDir, mainServer.indexPath);
|
|
195
198
|
this.loadMainUrl('spa', url, 'file');
|
|
@@ -325,7 +328,7 @@ class EeApp extends BaseApp {
|
|
|
325
328
|
* loading page
|
|
326
329
|
*/
|
|
327
330
|
_loadingPage(name) {
|
|
328
|
-
if (!
|
|
331
|
+
if (!UtilsHelper.fileIsExist(name)) {
|
|
329
332
|
return
|
|
330
333
|
}
|
|
331
334
|
|
package/html/index.js
ADDED
package/package.json
CHANGED
package/utils/helper.js
CHANGED
|
@@ -211,4 +211,11 @@ exports.getValueFromArgv = function(argv, key) {
|
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
return value;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
exports.fileIsExist = function(filepath) {
|
|
217
|
+
if (fs.existsSync(filepath) && fs.statSync(filepath).isFile()) {
|
|
218
|
+
return true;
|
|
219
|
+
}
|
|
220
|
+
return false;
|
|
214
221
|
};
|