ぼざクリ タグ広場 https://hub.nizika.monster
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
1010 B

  1. #!/usr/bin/env ruby
  2. require "fileutils"
  3. APP_ROOT = File.expand_path("..", __dir__)
  4. def system!(*args)
  5. system(*args, exception: true)
  6. end
  7. FileUtils.chdir APP_ROOT do
  8. # This script is a way to set up or update your development environment automatically.
  9. # This script is idempotent, so that you can run it at any time and get an expectable outcome.
  10. # Add necessary setup steps to this file.
  11. puts "== Installing dependencies =="
  12. system("bundle check") || system!("bundle install")
  13. # puts "\n== Copying sample files =="
  14. # unless File.exist?("config/database.yml")
  15. # FileUtils.cp "config/database.yml.sample", "config/database.yml"
  16. # end
  17. puts "\n== Preparing database =="
  18. system! "bin/rails db:prepare"
  19. puts "\n== Removing old logs and tempfiles =="
  20. system! "bin/rails log:clear tmp:clear"
  21. unless ARGV.include?("--skip-server")
  22. puts "\n== Starting development server =="
  23. STDOUT.flush # flush the output before exec(2) so that it displays
  24. exec "bin/dev"
  25. end
  26. end