fix: read type tags correctly after the first time

This commit is contained in:
Wieland Schöbl
2019-08-20 17:48:37 +02:00
parent 36bf17e323
commit 77e49146c0
4 changed files with 88 additions and 62 deletions

View File

@@ -93,11 +93,16 @@ commander
// get project reflection
const projectReflection = getProjectReflection(srcPath);
const mapping = generateTemplate(projectReflection, ignoredTagsList);
const result = generateTemplate(projectReflection, ignoredTagsList, true);
if (result.errors.length !== 0) {
await Logger.error('Mapping generated with errors!');
} else {
Logger.ok('Mapping generated without errors!');
}
// write documentation to file
// tslint:disable-next-line:no-magic-numbers
writeFileSync(mappingPath, JSON.stringify(mapping.template, null, 2));
writeFileSync(mappingPath, JSON.stringify(result.template, null, 2));
Logger.ok(`Elasticsearch mapping written to ${mappingPath}.`);
});