Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent unnecessary failures in *:check #691

Merged
merged 1 commit into from
Nov 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/apollo/src/commands/client/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ export default class ClientCheck extends ClientCommand {
({ type }: Change) => type === ChangeType.FAILURE
);

const exit = failures.length > 0 ? 1 : 0;

const count = operations.length;
this.log(`\n${count} operations extracted and validated`);
if (changes.length === 0) {
Expand All @@ -66,6 +64,9 @@ export default class ClientCheck extends ClientCommand {
});
this.log("\n");
// exit with failing status if we have failures
this.exit(exit);
if (failures.length > 0) {
this.exit();
}
return;
}
}
7 changes: 4 additions & 3 deletions packages/apollo/src/commands/service/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ export default class ServiceCheck extends ProjectCommand {
({ type }: Change) => type === ChangeType.FAILURE
);

const exit = failures.length > 0 ? 1 : 0;

if (changes.length === 0) {
return this.log("\nNo changes present between schemas\n");
}
Expand All @@ -65,6 +63,9 @@ export default class ServiceCheck extends ProjectCommand {
});
this.log("\n");
// exit with failing status if we have failures
this.exit(exit);
if (failures.length > 0) {
this.exit();
}
return;
}
}