Closed martensc closed 12 years ago
# --------------------------------------------
# capistrano-ash ASH overridden tasks
# --------------------------------------------
namespace :ash do
desc 'Copy distribution htaccess file'
task :htaccess, :roles => :web do
case true
when remote_file_exists?("#{latest_release}/htaccess.#{stage}.dist")
run "mv #{latest_release}/htaccess.#{stage}.dist #{latest_release}/.htaccess"
when remote_file_exists?("#{latest_release}/htaccess.#{stage}")
run "mv #{latest_release}/htaccess.#{stage} #{latest_release}/.htaccess"
when remote_file_exists?("#{latest_release}/htaccess.dist")
run "mv #{latest_release}/htaccess.dist #{latest_release}/.htaccess"
else
logger.important "Failed to move the .htaccess file in #{latest_release} because an unknown pattern was used"
end
end
end
something like this may work: