From 67517c58e3ea854a799ca9e0be81345c1ee716fb Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 5 Mar 2014 15:31:02 -0500 Subject: [PATCH] added warning if partial template was not found --- src/middleware/index.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/middleware/index.js b/src/middleware/index.js index f15394ca68..c3ab7ceb42 100644 --- a/src/middleware/index.js +++ b/src/middleware/index.js @@ -106,13 +106,12 @@ function compileTemplates() { matches = null; while (matches = file.match(//)) { - var partial = ""; - if (paths["/" + matches[1]]) { - partial = fs.readFileSync(paths["/" + matches[1]]).toString(); + file = file.replace(//, fs.readFileSync(paths["/" + matches[1]]).toString()); + } else { + winston.warn('[themes] Partial not found: ' + matches[1]); + file = file.replace(//, ""); } - - file = file.replace(//, partial); } mkdirp.sync(path.join(nconf.get('views_dir'), relative_path.split('/').slice(0, -1).join('/')));