@lerna/run-lifecycle
Advanced tools
Comparing version 3.2.0 to 3.3.0
@@ -6,2 +6,14 @@ # Change Log | ||
<a name="3.3.0"></a> | ||
# [3.3.0](https://github.com/lerna/lerna/compare/v3.2.1...v3.3.0) (2018-09-06) | ||
### Bug Fixes | ||
* **run-lifecycle:** Propagate exit code when execution fails ([4763f95](https://github.com/lerna/lerna/commit/4763f95)), closes [#1495](https://github.com/lerna/lerna/issues/1495) | ||
<a name="3.2.0"></a> | ||
@@ -8,0 +20,0 @@ # [3.2.0](https://github.com/lerna/lerna/compare/v3.1.4...v3.2.0) (2018-08-28) |
{ | ||
"name": "@lerna/run-lifecycle", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"description": "An internal Lerna tool", | ||
@@ -37,3 +37,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "02a2380b8f18c3579960032091643b9d12fd41e5" | ||
"gitHead": "901e6d54a47151dfed3d6ed2912804b97d05c6b5" | ||
} |
@@ -37,3 +37,22 @@ "use strict"; | ||
unsafePerm: true, | ||
}).then(() => pkg); | ||
}).then( | ||
() => pkg, | ||
err => { | ||
// error logging has already occurred on stderr, but we need to stop the chain | ||
log.error("lifecycle", "%j errored in %j, ejecting", stage, pkg.name); | ||
// ensure clean logging... | ||
err.pkg = pkg; | ||
// ...propagate the exit code... | ||
const exitCode = err.errno; | ||
// (using the property our yargs.fail() handler expects :P) | ||
err.code = exitCode; | ||
process.exitCode = exitCode; | ||
// ...and send it on its merry way | ||
throw err; | ||
} | ||
); | ||
} | ||
@@ -46,5 +65,3 @@ | ||
if (pkg.scripts && pkg.scripts[stage]) { | ||
return runLifecycle(pkg, stage, cfg).catch(err => { | ||
log.error("lifecycle", `error running ${stage} in ${pkg.name}\n`, err.stack || err); | ||
}); | ||
return runLifecycle(pkg, stage, cfg); | ||
} | ||
@@ -51,0 +68,0 @@ |
Sorry, the diff of this file is not supported yet
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
4885
53