Skip to content

Commit

Permalink
fix(writers): schemas check if index.ts exist
Browse files Browse the repository at this point in the history
  • Loading branch information
anymaniax committed Nov 12, 2020
1 parent 0ba9607 commit 905f9df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/writers/schemas.ts
@@ -1,4 +1,4 @@
import { existsSync, mkdirSync } from 'fs';
import { existsSync, mkdirSync, writeFileSync } from 'fs';
import { InfoObject } from 'openapi3-ts';
import { join } from 'path';
import { OutputOptions } from '../../types';
Expand Down Expand Up @@ -26,7 +26,9 @@ export const writeSchemas = ({
mkdirSync(schemaPath);
}

/* writeFileSync(join(schemaPath, '/index.ts'), ''); */
if (!existsSync(schemaPath + '/index.ts')) {
writeFileSync(join(schemaPath, '/index.ts'), '');
}

writeModels(schemas, schemaPath, info);
};

1 comment on commit 905f9df

@vercel
Copy link

@vercel vercel bot commented on 905f9df Nov 12, 2020

Choose a reason for hiding this comment

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

Please sign in to comment.