diff options
Diffstat (limited to 'lib/output/writer/writePage.js')
-rw-r--r-- | lib/output/writer/writePage.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/output/writer/writePage.js b/lib/output/writer/writePage.js index 23e37d0..6bcc1ba 100644 --- a/lib/output/writer/writePage.js +++ b/lib/output/writer/writePage.js @@ -27,7 +27,11 @@ function writePage(output, page, content, options) { var fileName = PathUtils.setExtension(file.getPath(), options.get('extension')); var filePath = path.join(rootFolder, fileName); - return fs.writeFile(filePath, content); + return fs.ensure(filePath) + .then(function() { + return fs.writeFile(filePath, content); + }) + .thenResolve(output); } module.exports = writePage; |