bin/setup
#!/usr/bin/env ruby
require 'pathname'
# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
Dir.chdir APP_ROOT do
puts "== Installing Ruby dependencies =="
system "gem install bundler --conservative"
system "bundle check || bundle install"
puts "\n== Installing JavaScript dependencies =="
system "yarn install"
puts "\n== Preparing database =="
system "bin/rake db:reset"
system "bin/rake db:test:prepare"
puts "\n== Generating development data =="
system "bin/rake porkchop:create_season"
system "bin/rake porkchop:simulate_matches"
puts "\n== Removing old logs and tempfiles =="
system "rm -f log/*"
system "rm -rf tmp/cache"
end