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

Write errors to stderr #178

Closed
Morten1337 opened this issue Apr 7, 2021 · 2 comments
Closed

Write errors to stderr #178

Morten1337 opened this issue Apr 7, 2021 · 2 comments

Comments

@Morten1337
Copy link
Contributor

In src/cli.js the program errors are written out with console.log.

Consider using console.error instead so that stderr and stdout can be redirected separately.

Like in my case I only want the the swagger output written to a file, and if there is a parsing error, I'd like to see that in the shell.

swagger-inline "./*.js" --base 'swaggerBase.json' 2>&1 > api.json
    .catch(err => {
-      console.log('An error occured:');
-      console.log(err);
+      console.log('An error occured:');
+     console.log(err);
      process.exit(-1);
    });
@erunion
Copy link
Member

erunion commented Apr 7, 2021

@Morten1337 If you're up for submitting a pull request we'll happily pull it in.

@erunion
Copy link
Member

erunion commented Apr 8, 2021

Done in #179

@erunion erunion closed this as completed Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants