From f09ef82246e56f6ddd0ea3f3f999a9fed93e77b7 Mon Sep 17 00:00:00 2001 From: Jeff Williams Date: Wed, 30 Jan 2013 17:31:05 -0800 Subject: [PATCH] don't throw an exception if there are no source files with JSDoc comments (#329) --- templates/default/publish.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/default/publish.js b/templates/default/publish.js index 0938c161..44fb9d20 100644 --- a/templates/default/publish.js +++ b/templates/default/publish.js @@ -361,7 +361,9 @@ exports.publish = function(taffyData, opts, tutorials) { fs.copyFileSync(fileName, toDir); }); - sourceFiles = shortenPaths( sourceFiles, path.commonPrefix(sourceFilePaths) ); + if (sourceFilePaths.length) { + sourceFiles = shortenPaths( sourceFiles, path.commonPrefix(sourceFilePaths) ); + } data().each(function(doclet) { var url = helper.createLink(doclet); helper.registerLink(doclet.longname, url);