Comparing version 2.1.1 to 3.0.0
@@ -37,5 +37,3 @@ #!/usr/bin/env node | ||
const packageJsonWorkspacesNohoistFormat = packageJsonWorkspaces && packageJsonWorkspaces.packages; | ||
const workspaceGlobs = packageJsonWorkspacesNohoistFormat || packageJsonWorkspaces || [ | ||
'packages/*' | ||
]; | ||
const workspaceGlobs = packageJsonWorkspacesNohoistFormat || packageJsonWorkspaces || ['packages/*']; | ||
const pkgs = workspace_1.listPkgs('./', workspaceGlobs); | ||
@@ -65,5 +63,3 @@ const pkgPaths = _.mapValues(_.keyBy(pkgs, p => p.json.name), v => v.path); | ||
if (hadError && fastExit) { | ||
console.error(chalk_1.default.red(`\nAborting execution and cancelling running scripts because an error occurred executing \`${cmd}\` for one of the packages.`)); | ||
console.error(' Run wsrun without option --fast-exit to keep going despite errors or with option --report to see which package caused the error.\n'); | ||
console.error(); | ||
console.error(chalk_1.default.red(`Aborted execution due to previous error`)); | ||
} | ||
@@ -70,0 +66,0 @@ process.exit(hadError ? 1 : 0); |
@@ -26,2 +26,3 @@ /// <reference types="node" /> | ||
readonly exitCode: Promise<number>; | ||
readonly exitError: Promise<void>; | ||
doneCriteria?: RegExp; | ||
@@ -28,0 +29,0 @@ constructor(cmd: string, pkgName: string, opts: CmdOptions); |
@@ -63,2 +63,8 @@ "use strict"; | ||
} | ||
get exitError() { | ||
return this.exitCode.then(c => { | ||
if (c != 0) | ||
throw new Error('`' + this.cmd + '` failed with exit code ' + c); | ||
}); | ||
} | ||
start() { | ||
@@ -244,2 +250,4 @@ this._start(this.cmd); | ||
}); | ||
if (this.opts.mode === 'parallel') | ||
finished = Promise.resolve(); | ||
return finished; | ||
@@ -296,2 +304,3 @@ }); | ||
return Promise.all(pkgs.map(pkg => this.lookupOrRun(cmd, pkg))) | ||
.then(() => Promise.all(this.children.map(c => c.exitError))) | ||
.catch(err => this.opts.fastExit && this.closeAll()) | ||
@@ -298,0 +307,0 @@ .then(() => this.checkResultsAndReport(cmd, pkgs)); |
{ | ||
"name": "wsrun", | ||
"version": "2.1.1", | ||
"version": "3.0.0", | ||
"description": "executes commands on packages in parallel, but is aware of the dependencies between them", | ||
@@ -44,3 +44,4 @@ "main": "./build/index.js", | ||
"test": "jest", | ||
"test:watch": "jest --watch" | ||
"test:watch": "jest --watch", | ||
"prepublish": "tsc" | ||
}, | ||
@@ -47,0 +48,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
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
53332
735