Revisions made by tamc up to 13:06 Sun 23 Apr 2006
Note, if you wish to edit or undo these revisions, please follow the links from here. You cannot do it from here, becuase someone may have edited the page more recently and because you may need a password to edit the page.
13:06 Sun 23 Apr 2006
- 0. h1. A rake task to set the file permissions and ownership in a rails project
- 1.
- 2. Darcs doesn't mange file permissions or ownership. To make it easy to setup file permissions after a @darcs get@ of a rails project I create a setup.rake file in lib/tasks with the following:
- 3.
- 4. <code>
- 5. <pre>
- 6. desc 'Set permissions on fast and cgi scripts'
- 7. task :set_permissions do
- 8. # Execute privelages
- 9. ['public','public/dispatch.cgi','public/dispatch.fcgi','public/dispatch.rb','script/*','script/process/*'].each do |file|
- 10. p `chmod a+x #{File.dirname(__FILE__) + '/../../' + file }`
- 11. end
- 12. # Write privelages
- 13. ['tmp','log','index','public/list','public/talk','public/user'].each do |file|
- 14. p `chmod -R a+rw #{File.dirname(__FILE__) + '/../../' + file }`
- 15. end
- 16. </pre>
- 17. </code>
- 18.
- 19. After a @darcs get@ I can then just run @rake set_permissions@ and be ready to run.