-
Notifications
You must be signed in to change notification settings - Fork 72
/
index.ts
27 lines (22 loc) · 941 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import path from 'path';
import { DOCS_DIR } from '@internals/common/constants';
import { mkdirp } from '@internals/common/fs';
import { writeModelReadmes } from './write-model-readmes.js';
import { verbose } from '@internals/common/logger';
import { info } from 'console';
import { getSharedArgs } from '../shared/get-shared-args.js';
import { clearOutMarkdownFiles } from '../shared/clear-out-markdown-files.js';
const targetDocDir = path.resolve(DOCS_DIR, 'docs/models/available');
const writeModelsDocumentation = async ({ shouldClearMarkdown }: { shouldClearMarkdown: boolean }) => {
info('Writing models documentation');
await mkdirp(targetDocDir);
if (shouldClearMarkdown) {
verbose(`Clearing out markdown files in ${targetDocDir}`)
await clearOutMarkdownFiles(targetDocDir);
}
return writeModelReadmes(targetDocDir);
};
const main = async () => {
return writeModelsDocumentation(getSharedArgs());
};
main();