jcoppieters / cody

Javascript Content Management System running on Node.js
howest.cody-cms.org
MIT License
678 stars 197 forks source link

Do not create controllers #28

Closed linksgo2011 closed 9 years ago

linksgo2011 commented 9 years ago

Error: ENOENT, no such file or directory 'd:\workspace\codydev\mysite\controller s' at Error (native) at Object.fs.readdirSync (fs.js:761:18) at Object. (d:\workspace\codydev\mysite.js:50:16) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Function.Module.runMain (module.js:501:10) at startup (node.js:129:16) at node.js:814:3

sylvainlap commented 9 years ago

I got the same error...

linksgo2011 commented 9 years ago

@sylvainlap Add a directory

ticup commented 9 years ago

You are both having this on windows, am i correct?

On 19 May 2015, at 04:09, linksgo2011 notifications@github.com wrote:

@sylvainlap Add a directory

— Reply to this email directly or view it on GitHub.

sylvainlap commented 9 years ago

Nope, on Ubuntu 15.04.

freele commented 9 years ago

I already had such error, first thing I did was copying all the controllers. But on the second thought I understood that it was exporting of your additional controllers. You can comment that block of code with errors until you add your custom controllers.
Or just create empty 'controllers' folder in your project folder.

jcoppieters commented 9 years ago

This happens because in create_site.js all directories are (should be) copied into the newly created project. However as "controllers" is empty, it is not copied...

[ to make a quick fix do a mkdir ./[your project]/controllers ]

Can someone have a look at "var copyRecursiveSync = function(src, dest) { ... }" why it doesn't (or does) live up to its comment "Look ma, it's cp -R." and change the code?

thanks, Johan.

ticup commented 9 years ago

The problem is that git doesn't track empty directories by itself. So the empty directory was never in the repository in to start. Stackoverflow Reference

I added a "YourController.js" to controllers, which fixes this and also demonstrates the boilerplate code to make your own Controller.

Committed here 912380bec8c1e9e13aac8543e0fc01f79c9cd329 and published on npm as v3.3.17.

Thanks all for your input!

jcoppieters commented 9 years ago

Did you remove my quick and dirty "mkdir controllers" in the create_site.js ?

ticup commented 9 years ago

Now I did. Didn't know you hacked it ;) We can wait till next version bump to push on into npm though, no harm.