Comparing version 4.9.2 to 4.9.3
@@ -0,1 +1,8 @@ | ||
## [4.9.3](https://github.com/oclif/cli-ux/compare/v4.9.2...v4.9.3) (2018-10-29) | ||
### Bug Fixes | ||
* clear prompt timeout ([#60](https://github.com/oclif/cli-ux/issues/60)) ([5cc36aa](https://github.com/oclif/cli-ux/commit/5cc36aa)) | ||
## [4.9.2](https://github.com/oclif/cli-ux/compare/v4.9.1...v4.9.2) (2018-10-29) | ||
@@ -2,0 +9,0 @@ |
@@ -87,2 +87,10 @@ "use strict"; | ||
return new Promise((resolve, reject) => { | ||
let timer; | ||
if (options.timeout) { | ||
timer = setTimeout(() => { | ||
process.stdin.pause(); | ||
reject(new Error('Prompt timeout')); | ||
}, options.timeout); | ||
timer.unref(); | ||
} | ||
process.stdin.setEncoding('utf8'); | ||
@@ -92,2 +100,4 @@ process.stderr.write(options.prompt); | ||
process.stdin.once('data', data => { | ||
if (timer) | ||
clearTimeout(timer); | ||
process.stdin.pause(); | ||
@@ -102,9 +112,3 @@ data = data.trim(); | ||
}); | ||
if (options.timeout) { | ||
setTimeout(() => { | ||
process.stdin.pause(); | ||
reject(new Error('Prompt timeout')); | ||
}, options.timeout).unref(); | ||
} | ||
}); | ||
} |
{ | ||
"name": "cli-ux", | ||
"description": "cli IO utilities", | ||
"version": "4.9.2", | ||
"version": "4.9.3", | ||
"author": "Jeff Dickey @jdxcode", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/oclif/cli-ux/issues", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
75034
1532