Skip to content

Commit

Permalink
mute stream when listing tasks - closes #24
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Nov 11, 2015
1 parent 08ad295 commit f6aec36
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/versioned/^3.7.0/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var chalk = require('chalk');
var gutil = require('gulp-util');
var stdout = require('mute-stdout');
var tildify = require('tildify');

var taskTree = require('./taskTree');
Expand All @@ -14,13 +15,21 @@ function execute(opts, env) {
var tasks = opts._;
var toRun = tasks.length ? tasks : ['default'];

if (opts.tasksSimple || opts.tasks) {
// Mute stdout if we are listing tasks
stdout.mute();
}

// This is what actually loads up the gulpfile
require(env.configPath);
gutil.log('Using gulpfile', chalk.magenta(tildify(env.configPath)));

var gulpInst = require(env.modulePath);
logEvents(gulpInst);

// Always unmute stdout after gulpfile is required
stdout.unmute();

process.nextTick(function() {
if (opts.tasksSimple) {
return logTasksSimple(env, gulpInst);
Expand Down
9 changes: 9 additions & 0 deletions lib/versioned/^4.0.0-alpha.1/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var fs = require('fs');

var chalk = require('chalk');
var gutil = require('gulp-util');
var stdout = require('mute-stdout');
var tildify = require('tildify');

var exit = require('../../shared/exit');
Expand All @@ -17,12 +18,20 @@ function execute(opts, env) {
var tasks = opts._;
var toRun = tasks.length ? tasks : ['default'];

if (opts.tasksSimple || opts.tasks || opts.tasksJson) {
// Mute stdout if we are listing tasks
stdout.mute();
}

var gulpInst = require(env.modulePath);
logEvents(gulpInst);

// This is what actually loads up the gulpfile
require(env.configPath);

// Always unmute stdout after gulpfile is required
stdout.unmute();

process.nextTick(function() {
if (opts.tasksSimple) {
return logTasksSimple(gulpInst.tree());
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"interpret": "^0.6.4",
"liftoff": "^2.1.0",
"matchdep": "^0.3.0",
"mute-stdout": "^0.1.0",
"pretty-hrtime": "^1.0.0",
"semver-greatest-satisfied-range": "^1.0.0",
"tildify": "^1.0.0",
Expand Down

0 comments on commit f6aec36

Please sign in to comment.