Fix "gitbook init" when article has no ref

This commit is contained in:
Samy Pesse
2016-05-10 09:55:22 +02:00
parent 308ece784c
commit 5b3f54fbc8
+5 -2
View File
@@ -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)