Skip to content

Instantly share code, notes, and snippets.

@sclarson
Created November 6, 2015 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sclarson/9ff2c0c4a02e3684d38a to your computer and use it in GitHub Desktop.
Save sclarson/9ff2c0c4a02e3684d38a to your computer and use it in GitHub Desktop.
var gulp = require('gulp');
var exec = require('child_process').exec;
var lintCommand = "cpplint *.cpp";
var buildCommand = 'g++ -std=c++11 -I/Users/scl/homebrew/include -L/Users/scl/homebrew/lib -lpugixml *.cpp && ./a.out';
gulp.task('build', function(){
exec(lintCommand, function (error, stdout, stderr){
console.log(lintCommand);
console.log(stdout);
console.log(stderr);
});
exec(buildCommand, function (error, stdout, stderr){
console.log(buildCommand);
console.log(stdout);
console.log(stderr);
});
});
gulp.task('watch',function(){
gulp.watch('./*.cpp',['build']);
gulp.watch('./*.h', ['build']);
});
gulp.task('default',['build','watch']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment