m19c / gulp-run

Pipe to shell commands in gulp
ISC License
151 stars 25 forks source link

Cannot get command output #38

Open vtkalek opened 9 years ago

vtkalek commented 9 years ago

Hi, I cant get the running command output. I'm trying to get info from git: " stream = run('git -C .docs status');

stream.exec();//.on('error', onError);

file = stream.read(); var content= file.contents.read(); console.log(content);"

But the output of 'content' is always null. And in console i see this:

Starting 'check_git_stats'... null On branch gh-pages Your branch is ahead of 'origin'............... nothing to commit, working directory clean

So at first it log the 'content' which is always null and then it actually runs the command and print its output.

But i need to get the output into content variable.

Looks like something is wrong with .exec() command, or maybe i didn't get it? So how to get command output to variable?