lib/magic_recipes/postgresql.rb in magic_recipes-0.1.2 vs lib/magic_recipes/postgresql.rb in magic_recipes-0.1.3

- old
+ new

@@ -89,17 +89,17 @@ run %Q{#{sudo} -u postgres psql -c "DROP DATABASE #{postgresql_database};"} end desc "Generate the database.yml configuration file." task :setup, roles: :app do - run "mkdir -p #{shared_path}/config" + run "#{sudo if use_sudo} mkdir -p #{shared_path}/config" template "postgresql.yml.erb", "#{shared_path}/config/postgres_#{rails_env}.yml" end after "deploy:setup", "postgresql:setup" desc "Symlink the database.yml file into latest release" task :symlink, roles: :app do - run "ln -nfs #{shared_path}/config/postgres_#{rails_env}.yml #{release_path}/config/database.yml" + run "#{sudo if use_sudo} ln -nfs #{shared_path}/config/postgres_#{rails_env}.yml #{release_path}/config/database.yml" end after "deploy:finalize_update", "postgresql:symlink" # http://stackoverflow.com/a/12939218/1470996 desc 'kill pgsql users so database can be dropped' \ No newline at end of file