JS-DevTools / globify

Run browserify and watchify with globs - even on Windows!
https://jstools.dev/globify/
MIT License
16 stars 6 forks source link

Unnecessary console.log #11

Open bsuh opened 8 years ago

bsuh commented 8 years ago

https://github.com/BigstickCarpet/globify/blob/master/lib/index.js#L49

Why is this here? It makes outputting to stdout instead of using --outfile useless because stdout contains a command before the browserify output.

JamesMessinger commented 8 years ago

It doesn't really make sense to use globify and output to stdout, since the whole purpose of globify is to output multiple bundles. Can you elaborate on your use-case?

bsuh commented 8 years ago

I just need the first feature, Windows glob support.

Features

JamesMessinger commented 8 years ago

Ah, ok. That's totally valid. Thanks for the clarification.

I've always used the --outfile argument, so I've never tested writing to stdout before. But you're right; it should be supported, and the console.log() statement interferes with that. I think the best fix is to wrap the console.log() statement in an if condition, based on whether the --outfile argument is present. If it's not present, then we can assume that the user intends to output to stdout, so we shouldn't log anything else.

bsuh commented 8 years ago

Thanks. Your fix sounds good. Sorry if I came off as caustic in the first comment. Working with browserify and co on Windows has been problematic and I spent that day looking at more fun issues with Windows like __dirname being /foo\bar\ and such :grimacing:

bcomnes commented 5 years ago

Ran across this issue today, the console.log breaks stdout when piping to other tools that expect a Browserify bundle piped into them.