fix: build

This commit is contained in:
2023-03-14 18:04:29 +01:00
parent 3792a14e90
commit fd740b3091
185 changed files with 21932 additions and 71486 deletions

View File

@@ -15,7 +15,7 @@
*/
import {Logger} from '@openstapps/logger';
import {Command} from 'commander';
import {readFileSync, writeFileSync} from 'fs';
import {mkdirSync, readFileSync, writeFileSync} from 'fs';
import got from 'got';
import path from 'path';
import {exit} from 'process';
@@ -65,18 +65,21 @@ commander
// write documentation to file
if (typeof options.aggPath !== 'undefined') {
const aggPath = path.resolve(options.aggPath);
mkdirSync(path.dirname(aggPath), {recursive: true});
// tslint:disable-next-line:no-magic-numbers
writeFileSync(aggPath, JSON.stringify(result.aggregations, null, 2));
Logger.ok(`Elasticsearch aggregations written to ${aggPath}.`);
}
if (typeof options.mappingPath !== 'undefined') {
const mappingPath = path.resolve(options.mappingPath);
mkdirSync(path.dirname(mappingPath), {recursive: true});
// tslint:disable-next-line:no-magic-numbers
writeFileSync(mappingPath, JSON.stringify(result.mappings, null, 2));
Logger.ok(`Elasticsearch mappings written to ${mappingPath}.`);
}
if (typeof options.errorPath !== 'undefined') {
const errorPath = path.resolve(options.errorPath);
mkdirSync(path.dirname(errPath), {recursive: true});
// tslint:disable-next-line:no-magic-numbers
writeFileSync(errorPath, JSON.stringify(result.errors, null, 2));
Logger.ok(`Mapping errors written to ${errorPath}.`);