Shell.js异步构建:等到meteor正在侦听打开meteor shell,运行命令,退出

时间:2015-07-28 14:09:45

标签: javascript node.js shell meteor

我的目标是在我的"捆绑"中执行以下步骤。导出电子应用程序的过程:

  1. 打开meteor目录
  2. run meteor
  3. 当流星正在聆听时,打开流星壳
  4. 通过"通电"命令meteor shell
  5. 当电气化建设完成后,返回。
  6. 到目前为止,我有以下

    require('shelljs/make');
    require('shelljs/global');
    var path = require('path');
    
    target.all = function () {
      target.bundle();
    }
    
    target.bundle = function () {
      console.log('Building for architecture: ' + process.platform + platform.arch);
      var meteorPath = path.join(__dirname, 'meteor');
      cd(meteorPath);
    
      // this runs for a while, make it asyncronous
      var meteorCommand = exec('meteor', { async: true });
      meteorCommand.stdout.on('data', function (data) {
        // ???
      });
    }
    

    这会产生预期的输出stdout

    Building for: darwinx64
    [[[[[ ~/Code/test/meteor-test ]]]]]
    
    => Started proxy.
    => Started MongoDB.
    => Babel active on file extensions: es6.js, es6, jsx
    I20150728-10:06:05.899(-4)? electrify:  installing electrified dependencies
    I20150728-10:06:07.005(-4)? electrify:  launching electron
    => Started your app.
    
    => App running at: http://localhost:3000/
    

    但是,我遇到了一个问题...... meteor有一个启动过程,需要先运行才能使用meteor shell,这是最后一步,它说" App运行于:& #34;

    如何在打开流星球之前等待此事件发生?

0 个答案:

没有答案