Skip to content
This repository has been archived by the owner on Oct 22, 2020. It is now read-only.

Commit

Permalink
Create output directory if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
pvorb committed Dec 17, 2013
1 parent 709a8c7 commit 64dd5c7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion write.js
Expand Up @@ -8,6 +8,7 @@ var ejs = require('ejs');
var esc = require('esc');
var props = require('props');
var pandoc = require('pdc');
var mkdirp = require('mkdirp');

module.exports = function write(reg, conf, cb) {
console.log('Beginning to write index and tag files.');
Expand Down Expand Up @@ -37,6 +38,8 @@ function indexes(reg, conf, cb) {
var dir = conf.directories;
var output = path.resolve(conf.root, dir.output);

mkdirp.sync(output);

// total number of indexes
var todo = conf.indexes.length;

Expand Down Expand Up @@ -173,6 +176,7 @@ function tags(reg, conf, cb) {

if (reg.tags) {
var tagDir = path.resolve(conf.root, dir.output, tags.directory);
mkdirp.sync(tagDir);

fs.readdir(dir.tags, function (err, files) {
if (!err)
Expand Down Expand Up @@ -207,7 +211,7 @@ function tags(reg, conf, cb) {
if (err)
return callback(err);

function writeTagFile(tag, p) {;
function writeTagFile(tag, p) {
p.__docs = docs;

var file = path.resolve(tagDir, tag+'.html');
Expand Down

0 comments on commit 64dd5c7

Please sign in to comment.