A rake task to set the file permissions and ownership in a rails project

A rake task to set the file permissions and ownership in a rails project

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

  1. 0. h1. A rake task to set the file permissions and ownership in a rails project
  2. 1.
  3. 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:
  4. 3.
  5. 4. <code>
  6. 5. <pre>
  7. 6. desc 'Set permissions on fast and cgi scripts'
  8. 7. task :set_permissions do
  9. 8. # Execute privelages
  10. 9. ['public','public/dispatch.cgi','public/dispatch.fcgi','public/dispatch.rb','script/*','script/process/*'].each do |file|
  11. 10. p `chmod a+x #{File.dirname(__FILE__) + '/../../' + file }`
  12. 11. end
  13. 12. # Write privelages
  14. 13. ['tmp','log','index','public/list','public/talk','public/user'].each do |file|
  15. 14. p `chmod -R a+rw #{File.dirname(__FILE__) + '/../../' + file }`
  16. 15. end
  17. 16. </pre>
  18. 17. </code>
  19. 18.
  20. 19. After a @darcs get@ I can then just run @rake set_permissions@ and be ready to run.
View, Edit or see all changes to this page.