git-time-metric / gtm

Simple, seamless, lightweight time tracking for Git
MIT License
973 stars 52 forks source link

Executing "gtm report" remain pending #94

Open CasvalDOT opened 5 years ago

CasvalDOT commented 5 years ago

I try to execute this command (gtm report) from a custom nodejs application. But seem that this command remain in pending status, without generating errors or output. Here the js code

const exec = require('child_process').exec
exec('bash -c "gtm report"',(err,stdout,stderr) => {
  // Here the script not enter :(
  console.error("Error",err)
  console.log("STDOUT",stdout)
  console.log("STDERR",stderr)
})

If i change command with a more simple gtm --help output is correct.


For testing purpose i do the same in go calling:

out, err := exec.Command("bash","-c","gtm report").Output()
if err != nil {
log.Fatal(err)
}
fmt.Printf("output is %s\n",out)

In this case out is empty. Can this issue related with the Spinner printed before results?

mschenk42 commented 5 years ago

Yes it is the spinner that is interrupting the reporting output. We would have to add an option to turn off the spinner for the reporting command if you want to grab it's output. I'll add that our list.

CasvalDOT commented 5 years ago

thanks for the answer!