File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env node
2
2
3
3
import fs from "node:fs" ;
4
+ import path from "path" ;
4
5
import { URL } from "node:url" ;
5
6
import glob from "fast-glob" ;
6
7
import parser from "yargs-parser" ;
@@ -177,8 +178,12 @@ async function main() {
177
178
await Promise . all (
178
179
inputSpecPaths . map ( async ( specPath ) => {
179
180
if ( flags . output !== "." && output === OUTPUT_FILE ) {
180
- if ( isGlob ) outputDir = new URL ( specPath , outputDir ) ;
181
- fs . mkdirSync ( outputDir , { recursive : true } ) ; // recursively make parent dirs
181
+ if ( isGlob ) {
182
+ fs . mkdirSync ( new URL ( path . dirname ( specPath ) , outputDir ) , { recursive : true } ) ; // recursively make parent dirs
183
+ }
184
+ else {
185
+ fs . mkdirSync ( outputDir , { recursive : true } ) ; // recursively make parent dirs
186
+ }
182
187
}
183
188
await generateSchema ( specPath ) ;
184
189
} )
You can’t perform that action at this time.
0 commit comments