Skip to content

Commit b64c224

Browse files
bugfix
1 parent 59952b8 commit b64c224

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/core-component/hook-pipe.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ export class HookPipe implements Hooks.Pipe {
2525
const resultSet: Hooks.ExecutionResult[] = [];
2626

2727
const resultList = await this.executeAll(true, Hooks.ExecutionMode.Filter);
28-
return { "success": resultList.failed.length > 0, "successfulHooks": resultList.successful, "failedHooks": resultList.failed, arguments: this.arguments };
28+
return { "success": resultList.failed.length === 0, "successfulHooks": resultList.successful, "failedHooks": resultList.failed, arguments: this.arguments };
2929
}
3030

3131
async runWithResultset(): Promise<Hooks.ExecutionSummary> {
3232
const resultList = await this.executeAll(false, Hooks.ExecutionMode.ResultSet);
33-
return { "success": resultList.failed.length > 0, "successfulHooks": resultList.successful, "failedHooks": resultList.failed, arguments: this.arguments };
33+
return { "success": resultList.failed.length === 0, "successfulHooks": resultList.successful, "failedHooks": resultList.failed, arguments: this.arguments };
3434
}
3535

3636
private async executeWithResultset(hookIndex: number, executionMode: Hooks.ExecutionMode): Promise<Hooks.HookResult> {
@@ -46,7 +46,7 @@ export class HookPipe implements Hooks.Pipe {
4646
if (typeof(this.hooks[i]) === "undefined") return;
4747

4848
const hookResult = await this.executeWithResultset(i, executionMode);
49-
hookResult.success ? successful.push(hookResult.result) : failed.push(hookResult.result);
49+
hookResult.success ? successful.push({ hook: this.hooks[i], result: hookResult.result }) : failed.push({ hook: this.hooks[i], result: hookResult.result });
5050

5151
if (!hookResult.success && stopOnFailure) {
5252
return;

src/interfaces/interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export namespace Hooks {
9292

9393
/**
9494
* runWithResultset()
95-
* Runs all hooks (regardless of each's return value) and calls onFinish afterwards.
95+
* Runs all hooks regardless of each's return value.
9696
*/
9797
runWithResultset(): Promise<Hooks.ExecutionSummary>;
9898
}

0 commit comments

Comments
 (0)