hereby 1.6.2 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/cli/runner.js +9 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
[](https://npmjs.com/package/hereby)
|
|
4
4
|
[](https://nodejs.org)
|
|
5
5
|
[](https://packagephobia.com/result?p=hereby)
|
|
6
|
+

|
|
6
7
|
[](https://github.com/jakebailey/hereby/actions/workflows/ci.yml)
|
|
7
8
|
[](https://codecov.io/gh/jakebailey/hereby)
|
|
8
9
|
|
package/dist/cli/runner.js
CHANGED
|
@@ -8,7 +8,10 @@ export class Runner {
|
|
|
8
8
|
this._d = d;
|
|
9
9
|
}
|
|
10
10
|
async runTasks(...tasks) {
|
|
11
|
-
|
|
11
|
+
// Using allSettled here so that we don't immediately exit; it could be
|
|
12
|
+
// the case that a task has code that needs to run before, e.g. a
|
|
13
|
+
// cleanup function in a "finally" or something.
|
|
14
|
+
const results = await Promise.allSettled(tasks.map((task) => {
|
|
12
15
|
const cached = this._addedTasks.get(task);
|
|
13
16
|
if (cached) {
|
|
14
17
|
return cached;
|
|
@@ -17,6 +20,11 @@ export class Runner {
|
|
|
17
20
|
this._addedTasks.set(task, promise);
|
|
18
21
|
return promise;
|
|
19
22
|
}));
|
|
23
|
+
for (const result of results) {
|
|
24
|
+
if (result.status === "rejected") {
|
|
25
|
+
throw result.reason;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
20
28
|
}
|
|
21
29
|
async _runTask(task) {
|
|
22
30
|
const { dependencies, run } = task.options;
|