Permalink
Browse files

Ensure parent dirs are created, improve error log

  • Loading branch information...
1 parent 14a5394 commit 8211d12f07710d92a510ddf06ec51d51d25b2c10 @pvorb committed Jan 7, 2014
Showing with 15 additions and 9,620 deletions.
  1. +0 −1 node_modules/props/.npmignore → .gitignore
  2. +13 −1 bake.js
  3. +0 −6 node_modules/.bin/marked.cmd
  4. +0 −1 node_modules/append/.npmignore
  5. +0 −18 node_modules/append/LICENSE.mkd
  6. +0 −31 node_modules/append/README.mkd
  7. +0 −5 node_modules/append/append.js
  8. +0 −23 node_modules/append/package.json
  9. +0 −9 node_modules/async/.gitmodules
  10. +0 −19 node_modules/async/LICENSE
  11. +0 −21 node_modules/async/Makefile
  12. +0 −1,022 node_modules/async/README.md
  13. +0 −70 node_modules/async/deps/nodeunit.css
  14. +0 −1,966 node_modules/async/deps/nodeunit.js
  15. +0 −1 node_modules/async/dist/async.min.js
  16. +0 −3 node_modules/async/index.js
  17. +0 −701 node_modules/async/lib/async.js
  18. +0 −4 node_modules/async/nodelint.cfg
  19. +0 −16 node_modules/async/package.json
  20. BIN node_modules/async/test/.swp
  21. +0 −1,625 node_modules/async/test/test-async.js
  22. +0 −24 node_modules/async/test/test.html
  23. +0 −1 node_modules/clone/.npmignore
  24. +0 −18 node_modules/clone/LICENSE.mkd
  25. +0 −53 node_modules/clone/README.mkd
  26. +0 −95 node_modules/clone/clone.js
  27. +0 −22 node_modules/clone/package.json
  28. +0 −1 node_modules/dive/.npmignore
  29. +0 −18 node_modules/dive/LICENSE.mkd
  30. +0 −81 node_modules/dive/README.mkd
  31. +0 −87 node_modules/dive/dive.js
  32. +0 −32 node_modules/dive/package.json
  33. 0 node_modules/ejs/.gitmodules
  34. +0 −4 node_modules/ejs/.npmignore
  35. +0 −88 node_modules/ejs/History.md
  36. +0 −21 node_modules/ejs/Makefile
  37. +0 −150 node_modules/ejs/Readme.md
  38. +0 −14 node_modules/ejs/benchmark.js
  39. +0 −565 node_modules/ejs/ejs.js
  40. +0 −2 node_modules/ejs/ejs.min.js
  41. +0 −24 node_modules/ejs/examples/client.html
  42. +0 −7 node_modules/ejs/examples/list.ejs
  43. +0 −14 node_modules/ejs/examples/list.js
  44. +0 −2 node_modules/ejs/index.js
  45. +0 −288 node_modules/ejs/lib/ejs.js
  46. +0 −198 node_modules/ejs/lib/filters.js
  47. +0 −23 node_modules/ejs/lib/utils.js
  48. +0 −11 node_modules/ejs/package.json
  49. +0 −173 node_modules/ejs/support/compile.js
  50. +0 −290 node_modules/ejs/test/ejs.test.js
  51. +0 −1 node_modules/ejs/test/fixtures/user.ejs
  52. +0 −2 node_modules/marked/.npmignore
  53. +0 −19 node_modules/marked/LICENSE
  54. +0 −10 node_modules/marked/Makefile
  55. +0 −135 node_modules/marked/README.md
  56. +0 −122 node_modules/marked/bin/marked
  57. +0 −1 node_modules/marked/index.js
  58. +0 −653 node_modules/marked/lib/marked.js
  59. +0 −14 node_modules/marked/package.json
  60. +0 −18 node_modules/props/LICENSE.mkd
  61. +0 −79 node_modules/props/README.mkd
  62. +0 −21 node_modules/props/node_modules/yamlparser/LICENSE
  63. +0 −48 node_modules/props/node_modules/yamlparser/README.markdown
  64. +0 −11 node_modules/props/node_modules/yamlparser/package.json
  65. +0 −62 node_modules/props/node_modules/yamlparser/tests/example.yml
  66. +0 −26 node_modules/props/node_modules/yamlparser/tests/index.html
  67. +0 −13 node_modules/props/node_modules/yamlparser/tests/server.js
  68. +0 −466 node_modules/props/node_modules/yamlparser/yamlparser.js
  69. +0 −27 node_modules/props/package.json
  70. +0 −42 node_modules/props/props.js
  71. +2 −1 package.json
@@ -1,2 +1 @@
node_modules/
-test/
View
14 bake.js
@@ -6,6 +6,7 @@ var ejs = require('ejs');
var async = require('async');
var clone = require('clone');
var append = require('append');
+var mkdirp = require('mkdirp');
// Main function
var bake = function(conf, hooks, cb) {
@@ -137,14 +138,25 @@ var bake = function(conf, hooks, cb) {
}
// Render ejs-template
- result = ejs.render(result, { locals: prop });
+ try {
+ result = ejs.render(result, { locals: prop });
+ } catch (err) {
+ console.error('\nAn error occurred:\n==================\n');
+ console.error('properties: ', prop);
+ console.error('template: ',
+ path.resolve(tplDir, prop.template));
+
+ throw err;
+ }
// Remove first slash
if (/^\//.test(prop._id))
prop._id = prop._id.substring(1);
// absolute path
resName = path.resolve(outputDir, prop._id);
+ var parentDir = path.resolve(resName, '..');
+ mkdirp.sync(parentDir);
// Write contents
fs.writeFile(resName, result, function(err) {

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 8211d12

Please sign in to comment.