Skip to content

Commit

Permalink
add support for arbitrary node-flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Kellen committed Sep 12, 2014
1 parent fb8c780 commit 99ccd09
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 10 additions & 2 deletions bin/gulp.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var archy = require('archy');
var Liftoff = require('liftoff');
var tildify = require('tildify');
var interpret = require('interpret');
var v8flags = require('v8flags');
var completion = require('../lib/completion');
var argv = require('minimist')(process.argv.slice(2));
var taskTree = require('../lib/taskTree');
Expand All @@ -20,7 +21,8 @@ process.env.INIT_CWD = process.cwd();
var cli = new Liftoff({
name: 'gulp',
completions: completion,
extensions: interpret.jsVariants
extensions: interpret.jsVariants,
nodeFlags: v8flags.fetch()
});

// exit with 0 or 1
Expand All @@ -47,7 +49,6 @@ if (!shouldLog) {
gutil.log = function(){};
}

// wire up a few err listeners to liftoff
cli.on('require', function (name) {
gutil.log('Requiring external module', chalk.magenta(name));
});
Expand All @@ -56,6 +57,13 @@ cli.on('requireFail', function (name) {
gutil.log(chalk.red('Failed to load external module'), chalk.magenta(name));
});

cli.on('respawn', function (flags, child) {
var nodeFlags = chalk.magenta(flags.join(', '));
var pid = chalk.magenta(child.pid);
gutil.log('Node flags detected:', nodeFlags);
gutil.log('Respawned to PID:', pid);
});

cli.launch({
cwd: argv.cwd,
configPath: argv.gulpfile,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@
"deprecated": "^0.0.1",
"gulp-util": "^3.0.0",
"interpret": "^0.3.2",
"liftoff": "^0.12.0",
"liftoff": "^0.13.2",
"minimist": "^1.1.0",
"orchestrator": "^0.3.0",
"pretty-hrtime": "^0.2.0",
"semver": "^3.0.1",
"tildify": "^1.0.0",
"v8flags": "^1.0.1",
"vinyl-fs": "^0.3.0"
},
"devDependencies": {
Expand Down

0 comments on commit 99ccd09

Please sign in to comment.