gulp-run icon indicating copy to clipboard operation
gulp-run copied to clipboard

Cannot get command output

Open vtkalek opened this issue 9 years ago • 0 comments

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?

vtkalek avatar Aug 21 '15 22:08 vtkalek