Can gulp collect lines grep:ed into single output file?

242 views Asked by At

I'm trying to filter out lines from all .js source files, and put into a separate file. (Specifically, I'm trying to grep all calls to a string translation function and post-process them).

I think I have the different parts figured out but can't make them fit together.

  1. For each file, process it
  2. Write each file's grep:ed lines to output.
  3. Append the result to a file

I've tried to through.push(<output per file>) from the plugin, but the following step expects a file, not a string.

From there, I expect I could do something like gulp-concat or stream merge on the results and pipe it on to gulp.dist, but there's bit missing here.

1

There are 1 answers

0
Ivan Milles On BEST ANSWER

I figured out a way - simply replace the Vinyl file's content with the lines to output, and push that through to through.push.