Gulp - 如何在终端中打开新选项卡? [英] Gulp – How Can I Open A New Tab In Terminal?

查看:117
本文介绍了Gulp - 如何在终端中打开新选项卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对OSX的终端知之甚少,但我希望通过gulp自动在终端中打开制表符,然后使用诸如gulp-shell之类的命令在其中运行gulp命令。例如,我想要在终端选项卡上启动mongoDB,并在另一个选项卡中启动我的应用程序。我怎么做到这一点?

I know little about OSX's Terminal, but I'd like to automatically open tabs in terminal via gulp, and then run gulp commands in them using something like gulp-shell. For instance, I'd like to have one gulp task that launches mongoDB in on terminal tab, and launches my app in another tab. How can I do this?

推荐答案

我有类似的问题,我不得不启动mongodb,然后启动scala服务器。看看这个答案,它帮助了我。
运行命令gulp启动Node.js服务器

I had similar issue, I had to start mongodb and then scala server. Take a look on this answer, it helped me. Running a command with gulp to start Node.js server

var exec = require('child_process').exec;
gulp.task('server', function (cb) {
  exec('node lib/app.js', function (err, stdout, stderr) {
    console.log(stdout);
    console.log(stderr);
    cb(err);
  });
  exec('mongod --dbpath ./data', function (err, stdout, stderr) {
    console.log(stdout);
    console.log(stderr);
    cb(err);
  });
})

这篇关于Gulp - 如何在终端中打开新选项卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆