Permalink
Browse files

Fix bug

  • Loading branch information...
1 parent 6c0b2bb commit 0a9cef6c197423259100870ce98b77e3cd1bf7c8 @pvorb committed Feb 16, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 bake.js
View
10 bake.js
@@ -129,19 +129,19 @@ var bake = function(conf, hooks, cb) {
// New file's path
if (typeof prop._id == 'undefined') {
prop._id = resName.replace(inputDir, '');
- prop._id = prop._id.replace(/\/, '/');
+ prop._id = prop._id.replace(/\\/, '/');
}
- // Add output dir
- resName = path.resolve(outputDir, prop._id);
-
// Render ejs-template
result = ejs.render(result, { locals: prop });
// Remove first slash
- if (/^\//, prop._id)
+ if (/^\//.test(prop._id))
prop._id = prop._id.substring(1)
+ // absolute path
+ resName = path.resolve(outputDir, prop._id);
+
// Write contents
fs.writeFile(resName, result, function(err) {
// Throw errors

0 comments on commit 0a9cef6

Please sign in to comment.