From ae28df8f8e4f2f3673dced7bab7b71d5fa48534b Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 3 Jan 2018 13:44:35 -0500 Subject: [PATCH] display error & warning when choosing an unexistant file --- lib/pipeline/pipeline.js | 7 +++++++ test_app/embark.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/pipeline/pipeline.js b/lib/pipeline/pipeline.js index 0dc2de94..996953d8 100644 --- a/lib/pipeline/pipeline.js +++ b/lib/pipeline/pipeline.js @@ -109,6 +109,10 @@ class Pipeline { } ], 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(); fileCb(null, {content: fileContent, filename: file.filename, path: file.path, modified: true}); }); @@ -121,6 +125,9 @@ class Pipeline { }, function (err, contentFiles) { + if (err) { + self.logger.warn('errors found while generating ' + targetFile); + } let dir = targetFile.split('/').slice(0, -1).join('/'); self.logger.trace("creating dir " + self.buildDir + dir); fs.mkdirpSync(self.buildDir + dir); diff --git a/test_app/embark.json b/test_app/embark.json index 116e6d6f..260767d1 100644 --- a/test_app/embark.json +++ b/test_app/embark.json @@ -6,7 +6,7 @@ "css/app.css": ["app/css/**"], "images/": ["app/images/**"], "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", "test.html": "app/test.html", "test2.html": "app/test2.html"