mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2911] Improved error message handling in doc tools (#3267)
This commit is contained in:
committed by
Eugenio Romano
parent
96fddbdc39
commit
8f9cb75120
@@ -47,7 +47,10 @@ function aggPhase(aggData) {
|
||||
|
||||
|
||||
function updatePhase(filenames, aggData) {
|
||||
var errorMessages;
|
||||
|
||||
for (var i = 0; i < filenames.length; i++) {
|
||||
errorMessages = [];
|
||||
var pathname = filenames[i]; // path.resolve(srcFolder, filenames[i]);
|
||||
|
||||
var src = fs.readFileSync(pathname);
|
||||
@@ -56,9 +59,13 @@ function updatePhase(filenames, aggData) {
|
||||
var modified = false;
|
||||
|
||||
toolList.forEach(toolName => {
|
||||
modified |= toolModules[toolName].updatePhase(tree, pathname, aggData);
|
||||
modified |= toolModules[toolName].updatePhase(tree, pathname, aggData, errorMessages);
|
||||
});
|
||||
|
||||
if (errorMessages.length > 0) {
|
||||
showErrors(pathname, errorMessages);
|
||||
}
|
||||
|
||||
if (modified)
|
||||
fs.writeFileSync(filenames[i], remark().use(frontMatter, {type: 'yaml', fence: '---'}).data("settings", {paddedTable: false, gfm: false}).stringify(tree));
|
||||
|
||||
@@ -67,6 +74,17 @@ function updatePhase(filenames, aggData) {
|
||||
}
|
||||
|
||||
|
||||
function showErrors(filename, errorMessages) {
|
||||
console.log(filename);
|
||||
|
||||
errorMessages.forEach(message => {
|
||||
console.log(" " + message);
|
||||
});
|
||||
|
||||
console.log("");
|
||||
}
|
||||
|
||||
|
||||
function loadToolModules() {
|
||||
var mods = {};
|
||||
var toolsFolderPath = path.resolve(__dirname, toolsFolderName);
|
||||
|
Reference in New Issue
Block a user