mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 16:42:56 +00:00
fix: build
This commit is contained in:
@@ -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}.`);
|
||||
|
||||
Reference in New Issue
Block a user