yeoman-environment
Advanced tools
Comparing version 2.3.0 to 2.3.1
@@ -35,2 +35,21 @@ 'use strict'; | ||
/** | ||
* Wrap callback so it can't get called twice | ||
*/ | ||
const callbackWrapper = (generator, done) => { | ||
if (!done) { | ||
return _.noop(); | ||
} | ||
let callbackHandled = false; | ||
const callback = err => { | ||
if (!callbackHandled) { | ||
callbackHandled = true; | ||
done(err); | ||
} | ||
}; | ||
// If error was thrown, make sure it is handled and only once | ||
generator.on('error', callback); | ||
return callback; | ||
}; | ||
/** | ||
* `Environment` object is responsible of handling the lifecyle and bootstrap | ||
@@ -457,3 +476,5 @@ * of generators in a specific environment (your app). | ||
return generator.run(done); | ||
const _callbackWrapper = callbackWrapper(generator, done); | ||
return generator.run(_callbackWrapper); | ||
} | ||
@@ -460,0 +481,0 @@ |
{ | ||
"name": "yeoman-environment", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "Handles the lifecyle and bootstrapping of generators in a specific environment", | ||
@@ -5,0 +5,0 @@ "homepage": "http://yeoman.io", |
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
37114
1010