Simplify development environment setup
Rails provides a script that already did most of the steps.
This commit is contained in:
13
bin/setup
13
bin/setup
@@ -17,13 +17,18 @@ FileUtils.chdir APP_ROOT do
|
||||
system! "gem install bundler --conservative"
|
||||
system("bundle check") || system!("bundle install")
|
||||
|
||||
# puts "\n== Copying sample files =="
|
||||
# unless File.exist?('config/database.yml')
|
||||
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
|
||||
# end
|
||||
puts "\n== Copying sample files =="
|
||||
unless File.exist?("config/database.yml")
|
||||
FileUtils.cp "config/database.yml.example", "config/database.yml"
|
||||
end
|
||||
|
||||
unless File.exist?("config/secrets.yml")
|
||||
FileUtils.cp "config/secrets.yml.example", "config/secrets.yml"
|
||||
end
|
||||
|
||||
puts "\n== Preparing database =="
|
||||
system! "bin/rails db:prepare"
|
||||
system! "RAILS_ENV=test bin/rails db:prepare"
|
||||
|
||||
puts "\n== Removing old logs and tempfiles =="
|
||||
system! "bin/rails log:clear tmp:clear"
|
||||
|
||||
Reference in New Issue
Block a user