We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4917ce2 commit f92f753Copy full SHA for f92f753
bin/cli.js
@@ -112,7 +112,11 @@ async function generateSchema(pathToSpec) {
112
const isDir = fs.existsSync(outputFilePath) && fs.lstatSync(outputFilePath).isDirectory();
113
if (isDir) {
114
const filename = pathToSpec.replace(EXT_RE, ".ts");
115
- outputFilePath = new URL(filename, outputFilePath);
+ const originalOutputFilePath = outputFilePath;
116
+ outputFilePath = new URL(filename, originalOutputFilePath);
117
+ if (outputFilePath.protocol !== 'file') {
118
+ outputFilePath = new URL(outputFilePath.host.replace(EXT_RE, ".ts"), originalOutputFilePath);
119
+ }
120
}
121
122
fs.writeFileSync(outputFilePath, result, "utf8");
0 commit comments