diff --git a/lib/parser.js b/lib/parser.js index 1c48e3d99d..a0952caa8c 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -36,6 +36,7 @@ function Parser(options) { this.dynamicIncludeSrc = []; this.staticIncludeSrc = []; this.boilerplateIncludeSrc = []; + this.missingIncludeSrc = []; } Parser.prototype.getDynamicIncludeSrc = function () { @@ -50,6 +51,10 @@ Parser.prototype.getBoilerplateIncludeSrc = function () { return _.clone(this.boilerplateIncludeSrc); }; +Parser.prototype.getMissingIncludeSrc = function () { + return _.clone(this.missingIncludeSrc); +}; + Parser.prototype._preprocess = function (element, context, config) { let self = this; element.attribs = element.attribs || {}; @@ -91,6 +96,9 @@ Parser.prototype._preprocess = function (element, context, config) { if (utils.fileExists(boilerplateFilePath)) { actualFilePath = boilerplateFilePath; this.boilerplateIncludeSrc.push({from: context.cwf, to: actualFilePath}); + } else { // both files are missing + this.missingIncludeSrc.push({from: context.cwf, to: actualFilePath}); + this.missingIncludeSrc.push({from: context.cwf, to: boilerplateFilePath}); } } @@ -327,6 +335,9 @@ Parser.prototype.includeFile = function (file, config) { if (utils.fileExists(boilerplateFilePath)) { actualFilePath = boilerplateFilePath; this.boilerplateIncludeSrc.push({from: context.cwf, to: boilerplateFilePath}); + } else { + this.missingIncludeSrc.push({from: context.cwf, to: actualFilePath}); + this.missingIncludeSrc.push({from: context.cwf, to: boilerplateFilePath}); } }