ee-core 2.0.0 → 2.0.1-bate.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/jobs/child/app.js CHANGED
@@ -3,7 +3,7 @@ const is = require('is-type-of');
3
3
  const Exception = require('ee-core/exception');
4
4
  const Loader = require('ee-core/loader');
5
5
  const Log = require('ee-core/log');
6
- const UtilsCore = require('../../core/lib/utils');
6
+ const UtilsCore = require('ee-core/core/lib/utils');
7
7
 
8
8
  // 开发环境下,ee-core是soft link
9
9
  // /node_modules[\\/]electron[\\/]/.test(process.execPath)
@@ -8,9 +8,16 @@ const Channel = require('../../const/channel');
8
8
  class ForkProcess {
9
9
  constructor(host, opt = {}) {
10
10
 
11
+ let cwd = Ps.getHomeDir();
12
+ let appPath = path.join(__dirname, 'app.js');
13
+ if (Ps.isPackaged()) {
14
+ // todo fork的cwd目录为什么要在app.asar外 ?
15
+ cwd = path.join(Ps.getHomeDir(), '..');
16
+ }
17
+
11
18
  let options = Object.assign({
12
19
  processOptions: {
13
- cwd: Ps.getHomeDir(),
20
+ cwd: cwd,
14
21
  env: Ps.allEnv(),
15
22
  stdio: 'pipe'
16
23
  }
@@ -23,9 +30,7 @@ class ForkProcess {
23
30
  // 传递给子进程的参数
24
31
  //this.args.push(JSON.stringify(options.params));
25
32
 
26
- const appPath = path.join(__dirname, 'app.js');
27
33
  this.child = fork(appPath, this.args, options.processOptions);
28
-
29
34
  this.pid = this.child.pid;
30
35
  this._init();
31
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ee-core",
3
- "version": "2.0.0",
3
+ "version": "2.0.1-bate.1",
4
4
  "description": "ee core",
5
5
  "main": "index.js",
6
6
  "scripts": {