File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,20 +6,22 @@ import { glob } from "glob";
66
77
88const BANNER_COMMENT = '// THIS IS A AUTO-GENERATED FILE. DO NOT MODIFY MANUALLY!\n' ;
9- // const SCHEMAS: string[] = ["github.json", "shared.json"];
109
1110( async ( ) => {
1211 const cwd = process . cwd ( ) ;
1312 const schemasBasePath = path . resolve ( `${ cwd } /../../schemas` ) ;
14- const schemas = await glob ( `${ schemasBasePath } /**/*.json` )
13+ const outDirRoot = path . resolve ( `${ cwd } /src` ) ;
14+ const schemas = await glob ( `${ schemasBasePath } /**/*.json` ) ;
15+
16+ // Clean output directory first
17+ await rm ( outDirRoot , { recursive : true , force : true } ) ;
18+
1519
1620 await Promise . all ( schemas . map ( async ( schemaPath ) => {
1721 const name = path . parse ( schemaPath ) . name ;
1822 const version = path . basename ( path . dirname ( schemaPath ) ) ;
19- const outDir = path . join ( cwd , `src/ ${ version } ` ) ;
23+ const outDir = path . join ( outDirRoot , version ) ;
2024
21- // Clean output directory first
22- await rm ( outDir , { recursive : true , force : true } ) ;
2325 await mkdir ( outDir , { recursive : true } ) ;
2426
2527 // Generate schema
You can’t perform that action at this time.
0 commit comments