UNPKG

635 BJavaScriptView Raw
1var gulp = require('gulp');
2var run = require('./');
3
4
5gulp.task('build-parser', function (done) {
6 run('canopy lib/command-parser.peg').exec(true)
7 .pipe(call(done))
8});
9
10
11gulp.task('default', ['build-parser']);
12
13
14/// Helpers
15/// --------------------------------------------------
16var Stream = require('stream');
17
18// Get a vinyl stream that calls a function whenever a file is piped in.
19var call = function (callback1) {
20 var stream = new Stream.Transform({objectMode:true});
21 stream._transform = function (file, enc, callback2) {
22 this.push(file);
23 process.nextTick(callback2);
24 process.nextTick(callback1);
25 }
26 return stream;
27}