Skip to content

Commit

Permalink
Fixed rake task to copy config, so that database.yml is always overwr…
Browse files Browse the repository at this point in the history
…itten [ci skip]
  • Loading branch information
ndbroadbent committed Dec 13, 2011
1 parent cdde027 commit d902379
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions lib/tasks/fat_free_crm.rake
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,9 @@ end
namespace :crm do
desc "Copy example config files"
task :copy_default_config do
config_files = { "database.#{ENV['DB'] || 'postgres'}.yml" => 'database.yml',
'settings.yml.example' => 'settings.yml' }
puts "Copying example config files..."
config_files.each do |old, new|
if File.exists?("config/#{new}")
puts "-- Skipping config/#{new}: already exists"
else
puts "-- Copying config/#{old} to config/#{new}"
FileUtils.cp "config/#{old}", "config/#{new}"
end
end
puts "Copying example config files..."
FileUtils.cp "config/settings.yml.example", "config/settings.yml" unless File.exists?("config/settings.yml")
FileUtils.cp "config/database.#{ENV['DB'] || 'postgres'}.yml", 'config/database.yml'
end

namespace :settings do
Expand Down

0 comments on commit d902379

Please sign in to comment.