Fix infinite spinner on --collect-only (#101)

In --collect-only, the CLI wasn't stopping the spinner after it completed. The spinner uses `setInterval` so it would just keep going indefinitely, preventing the process from exiting. Now it's correctly stopped.
This commit is contained in:
Renée Kooi 2018-12-12 09:52:35 +01:00 committed by GitHub
parent f4f983ec6a
commit 72472d0756
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

4
bin.js
View File

@ -355,6 +355,10 @@ function runTool (args, Tool, version, uiOptions) {
process.once('SIGINT', onsigint)
tool.collect(args['--'], function (err, filename) {
if (err) throw err
if (spinner.isEnabled) {
spinner.stop()
spinner.stream.write(`${spinner.text}\n`)
}
console.log(`Output file is ${filename}`)
})
} else if (args['visualize-only']) {