From dd469bf0162a22354747bfb0373899f27900a1eb Mon Sep 17 00:00:00 2001
From: fool2fish <fool2fish@gmail.com>
Date: Wed, 22 Oct 2014 18:36:33 +0800
Subject: [PATCH] Check the format of config.macro and config.template.

---
 lib/handle-cfg.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/handle-cfg.js b/lib/handle-cfg.js
index 42ef3ab..ab3b63a 100644
--- a/lib/handle-cfg.js
+++ b/lib/handle-cfg.js
@@ -57,10 +57,12 @@ function str2Obj(raw) {
       raw: raw,
       fullPath: path.resolve(raw)
     }
-  } else {
+  } else if (utilx.isString(raw)){
     return {
       isFile: false,
       raw: raw
     }
+  } else {
+    logger.error('Value of config.value or config.template must be a file path or a velocity string.')
   }
 }