Skip to content

Commit 02c3f32

Browse files
trevor-scheerJames Baxley
authored andcommitted
Fix unnecessary failures in *:check (#691)
*:check currently calls this.exit() on success cases. This should only be called if there are failures, else the script throws an error.
1 parent a1255bc commit 02c3f32

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

packages/apollo/src/commands/client/check.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ export default class ClientCheck extends ClientCommand {
4949
({ type }: Change) => type === ChangeType.FAILURE
5050
);
5151

52-
const exit = failures.length > 0 ? 1 : 0;
53-
5452
const count = operations.length;
5553
this.log(`\n${count} operations extracted and validated`);
5654
if (changes.length === 0) {
@@ -66,6 +64,9 @@ export default class ClientCheck extends ClientCommand {
6664
});
6765
this.log("\n");
6866
// exit with failing status if we have failures
69-
this.exit(exit);
67+
if (failures.length > 0) {
68+
this.exit();
69+
}
70+
return;
7071
}
7172
}

packages/apollo/src/commands/service/check.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ export default class ServiceCheck extends ProjectCommand {
5050
({ type }: Change) => type === ChangeType.FAILURE
5151
);
5252

53-
const exit = failures.length > 0 ? 1 : 0;
54-
5553
if (changes.length === 0) {
5654
return this.log("\nNo changes present between schemas\n");
5755
}
@@ -65,6 +63,9 @@ export default class ServiceCheck extends ProjectCommand {
6563
});
6664
this.log("\n");
6765
// exit with failing status if we have failures
68-
this.exit(exit);
66+
if (failures.length > 0) {
67+
this.exit();
68+
}
69+
return;
6970
}
7071
}

0 commit comments

Comments
 (0)