summaryrefslogtreecommitdiffstats
path: root/lib/init.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/init.js')
-rw-r--r--lib/init.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/init.js b/lib/init.js
index 3e3cdca..c112d4d 100644
--- a/lib/init.js
+++ b/lib/init.js
@@ -47,8 +47,11 @@ function initBook(rootFolder) {
// Write pages
return Promise.forEach(articles, function(article) {
- var filePath = path.join(rootFolder, article.getPath());
- if (!filePath) return;
+ var articlePath = article.getPath();
+ var filePath = articlePath? path.join(rootFolder, articlePath) : null;
+ if (!filePath) {
+ return;
+ }
return fs.assertFile(filePath, function() {
return fs.ensureFile(filePath)