@oclif/core
Advanced tools
Comparing version 0.5.34 to 0.5.35
@@ -5,2 +5,9 @@ # Changelog | ||
### [0.5.35](https://github.com/oclif/core/compare/v0.5.34...v0.5.35) (2021-09-08) | ||
### Bug Fixes | ||
* clear hook timeout ([#243](https://github.com/oclif/core/issues/243)) ([0c32c65](https://github.com/oclif/core/commit/0c32c65c5c30b02bc3ea6e36b0598adfc5b23ec1)) | ||
### [0.5.34](https://github.com/oclif/core/compare/v0.5.33...v0.5.34) (2021-08-30) | ||
@@ -7,0 +14,0 @@ |
@@ -140,4 +140,12 @@ "use strict"; | ||
const withTimeout = async (ms, promise) => { | ||
const timeout = new Promise((_, reject) => setTimeout(() => reject(new Error(`Timed out after ${ms} ms.`)), ms)); | ||
return Promise.race([promise, timeout]); | ||
let id; | ||
const timeout = new Promise((_, reject) => { | ||
id = setTimeout(() => { | ||
reject(new Error(`Timed out after ${ms} ms.`)); | ||
}, ms); | ||
}); | ||
return Promise.race([promise, timeout]).then(result => { | ||
clearTimeout(id); | ||
return result; | ||
}); | ||
}; | ||
@@ -177,3 +185,3 @@ const successes = []; | ||
catch (error) { | ||
failures.push({ plugin: p, error }); | ||
failures.push({ plugin: p, error: error }); | ||
if (error && error.oclif && error.oclif.exit !== undefined) | ||
@@ -180,0 +188,0 @@ throw error; |
@@ -93,3 +93,3 @@ import { Command } from './command'; | ||
failures: Array<{ | ||
error: typeof Error; | ||
error: Error; | ||
plugin: Plugin; | ||
@@ -96,0 +96,0 @@ }>; |
{ | ||
"name": "@oclif/core", | ||
"description": "base library for oclif CLIs", | ||
"version": "0.5.34", | ||
"version": "0.5.35", | ||
"author": "Jeff Dickey @jdxcode", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/oclif/core/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
207256
5188