Fix edgecase in gulpfile.js

There seem's to be an edgecase where a spawned process (in this case node.exe it self) is opened and gulp straight away thinks it closed. At first I thought it was a problem with Gulp, but after fiddleing it seem's to be a Window's problem, so I just updated the `node()` spawner to work on all platforms by using Gulp's callback to create an async task. Problem solved :)
master
Futago-za Ryuu 7 years ago
parent b0056d7a9f
commit 1b2072f239

@ -17,9 +17,16 @@ const header = require( "gulp-header" );
const del = require( "del" );
const runSequence = require( "run-sequence" );
function node( args ) {
function node( args, cb ) {
return spawn( "node", args.split( " " ), { stdio: "inherit" } );
spawn( "node", args.split( " " ), { stdio: "inherit" } )
.on( "error", cb )
.on( "close", code => {
if ( ! code ) cb();
} );
}
@ -49,12 +56,18 @@ task( "test", () => gulp
);
// Run benchmarks.
task( "benchmark", () => node( "test/benchmark/run" ) );
task( "benchmark", cb => {
node( "test/benchmark/run", cb );
} );
// Generate the grammar parser.
task( "build:parser", () =>
node( "bin/peg src/parser.pegjs -o lib/parser.js -c src/config.json" )
);
task( "build:parser", cb => {
node( "bin/peg src/parser.pegjs -o lib/parser.js -c src/config.json", cb );
} );
// Create the browser build.
task( "build:browser", () => {

Loading…
Cancel
Save