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

Fix incorrect check for protocol #1088

Merged
merged 1 commit into from
Apr 26, 2023
Merged

Conversation

happycollision
Copy link
Contributor

Changes

What does this PR change? Link to any related issue(s).

I couldn't find an issue. But here is my error:

Error: EISDIR: illegal operation on a directory, open '/Users/don.denton/GitProjects/my-project/server-sdk/'
    at Object.openSync (node:fs:601:3)
    at Object.writeFileSync (node:fs:2249:35)
    at generateSchema (file:///Users/don.denton/.npm/_npx/f0a53e56ae94fd64/node_modules/openapi-typescript/bin/cli.js:136:8)
    at async file:///Users/don.denton/.npm/_npx/f0a53e56ae94fd64/node_modules/openapi-typescript/bin/cli.js:209:7
    at async Promise.all (index 0)
    at async main (file:///Users/don.denton/.npm/_npx/f0a53e56ae94fd64/node_modules/openapi-typescript/bin/cli.js:199:3) {
  errno: -21,
  syscall: 'open',
  code: 'EISDIR',
  path: '/Users/don.denton/GitProjects/my-project/server-sdk/'
}

When I log out the outputFilePath.protocol right before this check, it is "file:" (with a colon). After this change, my error goes away and the task completes.

How to Review

How can a reviewer review your changes? What should be kept in mind for this review?

Not sure how to reproduce the error without my exact setup... just haven't looked into it. Hence, not adding a test at the moment.

Checklist

  • Unit tests updated
  • README updated
  • examples/ directory updated (if applicable)

Copy link
Contributor

@drwpow drwpow left a comment

Choose a reason for hiding this comment

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

Thank you!

@happycollision
Copy link
Contributor Author

Holy cow, that was a fast approval! Thanks!

@drwpow drwpow merged commit c95fafc into openapi-ts:main Apr 26, 2023
5 checks passed
@drwpow
Copy link
Contributor

drwpow commented Apr 26, 2023

@all-contributors please add @happycollision for code, bug

@allcontributors
Copy link
Contributor

@drwpow

I've put up a pull request to add @happycollision! 🎉

@drwpow
Copy link
Contributor

drwpow commented Apr 26, 2023

Holy cow, that was a fast approval! Thanks!

Just happened to be working on another bugfix (#1065) at the moment. So this change will be released later today!

@happycollision happycollision deleted the patch-1 branch April 26, 2023 18:51
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

Successfully merging this pull request may close these issues.

None yet

3 participants