Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require('child_process').exec('git summary') #348

Closed
zxdong262 opened this issue Apr 11, 2015 · 2 comments · Fixed by #1065
Closed

require('child_process').exec('git summary') #348

zxdong262 opened this issue Apr 11, 2015 · 2 comments · Fixed by #1065

Comments

@zxdong262
Copy link

get nothing, but require('child_process').exec('git summary --line') will get the right stdout.

var exec = require('child_process').exec
exec('git summary', function(err, stdout) {
    //nothing in here works
})

exec('git summary --line', function(err, stdout) {
    //works fine
    assert(stdout)
})

When I try use node to get the stdout from git summary, I find this strange thing, do not know why.
I hope it can be fixed.
Thanks.

@hemanth
Copy link
Collaborator

hemanth commented Apr 11, 2015

hmm?

@spacewander
Copy link
Collaborator

I just wrote some code to reproduce it:

var exec = require('child_process').exec
exec('git summary', function(err, stdout) {
    console.log(stdout);
})

Got nothing.

However,

exec "git summary" if fork.nil? # ruby code

This time it output correct result.

So, I guess it is not a bug of git-extras.
@zxdong262 Maybe you need to dive into child_process?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants