From 132a6da310fb6b3de5bafbc7cee17fcf32999b1f Mon Sep 17 00:00:00 2001 From: Frank Steidinger Date: Thu, 20 Sep 2012 12:35:27 +0200 Subject: [PATCH] Prevent default template from trying to copy its static files into themselves if env.dirname contains a backslash. Otherwise they end up empty. Filenames provided by fs.ls already use slashes instead of backslashes so the replace(fromDir, toDir) does nothing and the file is truncated. (Issue #190) --- templates/default/publish.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/default/publish.js b/templates/default/publish.js index 312b2d9f..20137435 100644 --- a/templates/default/publish.js +++ b/templates/default/publish.js @@ -237,7 +237,7 @@ exports.publish = function(taffyData, opts, tutorials) { fs.mkPath(outdir); // copy static files to outdir - var fromDir = env.dirname + '/' + templatePath + '/static', + var fromDir = env.dirname.replace(/\\/g, "/") + '/' + templatePath + '/static', staticFiles = fs.ls(fromDir, 3); staticFiles.forEach(function(fileName) {