display error & warning when choosing an unexistant file

This commit is contained in:
Iuri Matias 2018-01-03 13:44:35 -05:00
parent 4b8a353720
commit ae28df8f8e
2 changed files with 8 additions and 1 deletions

View File

@ -109,6 +109,10 @@ class Pipeline {
} }
], function(_err, _result) { ], function(_err, _result) {
if (!fs.existsSync('./.embark/' + file.filename)) {
self.logger.error("coudln't find file: " + file.filename);
return fileCb("couldn't find file: " + file.filename);
}
let fileContent = fs.readFileSync('./.embark/' + file.filename).toString(); let fileContent = fs.readFileSync('./.embark/' + file.filename).toString();
fileCb(null, {content: fileContent, filename: file.filename, path: file.path, modified: true}); fileCb(null, {content: fileContent, filename: file.filename, path: file.path, modified: true});
}); });
@ -121,6 +125,9 @@ class Pipeline {
}, },
function (err, contentFiles) { function (err, contentFiles) {
if (err) {
self.logger.warn('errors found while generating ' + targetFile);
}
let dir = targetFile.split('/').slice(0, -1).join('/'); let dir = targetFile.split('/').slice(0, -1).join('/');
self.logger.trace("creating dir " + self.buildDir + dir); self.logger.trace("creating dir " + self.buildDir + dir);
fs.mkdirpSync(self.buildDir + dir); fs.mkdirpSync(self.buildDir + dir);

View File

@ -6,7 +6,7 @@
"css/app.css": ["app/css/**"], "css/app.css": ["app/css/**"],
"images/": ["app/images/**"], "images/": ["app/images/**"],
"js/app.js": ["app/js/index.js"], "js/app.js": ["app/js/index.js"],
"js/test.js": ["app/js/_vendor/jquery.min.js", "app/js/_vendor/async.min.js", "app/js/test.js"], "js/test.js": ["app/js/_vendor/jquery.min.js", "app/js/_vendor/async.min.js", "app/js/test.js", "app/js/non_existant_file.js"],
"index.html": "app/index.html", "index.html": "app/index.html",
"test.html": "app/test.html", "test.html": "app/test.html",
"test2.html": "app/test2.html" "test2.html": "app/test2.html"