Skip to content

Commit

Permalink
refactor: remove unnecessary browser check (#8002)
Browse files Browse the repository at this point in the history
* refactor: remove unecessary browser check

* typo
  • Loading branch information
saihaj committed Jun 30, 2022
1 parent 8150a9c commit e050230
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/early-pots-leave.md
@@ -0,0 +1,5 @@
---
'@graphql-codegen/cli': minor
---

Remove unnecessary browser check
5 changes: 1 addition & 4 deletions packages/graphql-codegen-cli/src/utils/cli-error.ts
@@ -1,5 +1,4 @@
import { DetailedError } from '@graphql-codegen/plugin-helpers';
import { isBrowser, isNode } from './is-browser';

type CompositeError = Error | DetailedError;
type ListrError = Error & { errors: CompositeError[] };
Expand All @@ -21,9 +20,7 @@ export function cliError(err: any, exitOnError = true) {
// eslint-disable-next-line no-console
console.error(msg);

if (exitOnError && isNode) {
if (exitOnError) {
process.exit(1);
} else if (exitOnError && isBrowser) {
throw err;
}
}
7 changes: 0 additions & 7 deletions packages/graphql-codegen-cli/src/utils/is-browser.ts

This file was deleted.

1 comment on commit e050230

@vercel
Copy link

@vercel vercel bot commented on e050230 Jun 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.