stav/wgrep

Will run, but not grep.

almereyda opened this issue · 1 comments

Running this command will fetch the specified URL and print it, without grepping the selected terms:

# yala @ pons in ~/src/github.com/stav/wgrep on git:master x [21:34:24] 
$ wgrep "timeline" https://github.com/almereyda/awesome-starred/raw/master/README.md | wc -l
11135

# yala @ pons in ~/src/github.com/stav/wgrep on git:master x [21:34:31] 
$ curl -sL https://github.com/almereyda/awesome-starred/raw/master/README.md | wc -l        
11134

A workaround is to use curl -sL ... | grep ... natively:

# yala @ pons in ~/src/github.com/stav/wgrep on git:master x [21:34:43] 
$ curl -sL https://github.com/almereyda/awesome-starred/raw/master/README.md | grep timeline | wc -l
40

stav commented

I do get a redirect error from Puppeteer but the file does get downloaded and it looks like it is properly grepped:

$ wgrep "timeline" https://github.com/almereyda/awesome-starred/raw/master/README.md

Calling for "timeline" in "output" from "https://github.com/almereyda/awesome-starred/raw/master/README.md" with user "undefined"

Error: Response body is unavailable for redirect responses
  https://github.com/almereyda/awesome-starred/raw/master/README.md
  /home/stav/Public/stav/wgrep/output/almereyda/awesome-starred/raw/master/README.md
  Errors { flag: true, net: 0, buf: 1, main: 0, page: 0 }

Looking in "output" for 'timeline'
Found 1 files
[ 'output/almereyda/awesome-starred/master/README.md' ]

Note this utility does not print the actual lines it found it on, only the files that it found it in; similar to the -l switch:

$ grep -l timeline -r output/

output/almereyda/awesome-starred/master/README.md