Permalink
Browse files

Merge pull request #41 from ymainier/master

Error while generating HTML report, fixes #40
  • Loading branch information...
2 parents c2ed15b + ef081b0 commit 889a5e2af8d542958a10da1a645596148dcb4161 @gotwarlost committed Mar 27, 2013
Showing with 9 additions and 3 deletions.
  1. +9 −3 lib/report/html.js
View
@@ -497,10 +497,16 @@ Report.mix(HtmlReport, {
});
tree = summarizer.getTreeSummary();
fs.readdirSync(path.resolve(__dirname, '..', 'vendor')).forEach(function (f) {
- if (opts.verbose) {
- console.log('Write asset: ' + path.resolve(dir, f));
+ var resolvedSource = path.resolve(__dirname, '..', 'vendor', f),
+ resolvedDestination = path.resolve(dir, f),
+ stat = fs.statSync(resolvedSource);
+
+ if (stat.isFile()) {
+ if (opts.verbose) {
+ console.log('Write asset: ' + resolvedDestination);
+ }
+ writer.copyFile(resolvedSource, resolvedDestination);
}
- writer.copyFile(path.resolve(__dirname, '..', 'vendor', f), path.resolve(dir, f));
});
//console.log(JSON.stringify(tree.root, undefined, 4));
this.writeFiles(writer, tree.root, dir, collector);

0 comments on commit 889a5e2

Please sign in to comment.