move the innards of the ash:fixperms to their own separate methods for fixing permissions on files and directories
so instead of this:
# in lib/ash/base.rb
namespace :ash do
desc "Set standard permissions for Ash servers"
task :fixperms, :roles => :web, :except => { :no_release => true } do
# chmod the files and directories.
try_sudo "find #{latest_release} -type d -exec chmod 755 {} \\;"
try_sudo "find #{latest_release} -type f -exec chmod 644 {} \\;"
end
end
we could do something like this:
# in lib/ash/base.rb
namespace :ash do
desc "Set standard permissions for Ash servers"
task :fixperms, :roles => :web, :except => { :no_release => true } do
# chmod the files and directories.
fix_perms_files("#{latest_release}")
fix_perms_dirs("#{latest_release}")
end
end
# in lib/ash/common.rb
# recursively fix file permissions
# defaults to the the current working directory
# and normal file permissions of 644
def fix_perms_files(path_to_directory = ".", permissions = 644)
try_sudo "find #{path_to_directory} -type f -exec chmod #{permissions} {} \\;"
end
# recursively fix directory permissions
# defaults to the the current working directory
# and normal directory permissions of 755
def fix_perms_dirs(path_to_directory = ".", permissions = 755)
try_sudo "find #{path_to_directory} -type d -exec chmod #{permissions} {} \\;"
end
move the innards of the ash:fixperms to their own separate methods for fixing permissions on files and directories
so instead of this:
we could do something like this: