Sha256: 5b46d71f4d87623c73d778bae306d0ce6630599be556d8a9980625a2ac004809

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

require 'pathname'
require 'fileutils'
include FileUtils

# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)

def system!(*args)
  system(*args) || abort("\n== Command #{args} failed ==")
end

chdir APP_ROOT do
  # This script is a starting point to setup your application.
  # Add necessary setup steps to this file.

  puts '== Installing dependencies =='
  system! 'gem install bundler --conservative'
  system('bundle check') || system!('bundle install')
<% unless options[:skip_yarn] %>
  # Install JavaScript dependencies if using Yarn
  # system('bin/yarn')

<% end %>
<% unless options.skip_active_record -%>
  # puts "\n== Copying sample files =="
  # unless File.exist?('config/database.yml')
  #   cp 'config/database.yml.sample', 'config/database.yml'
  # end

  puts "\n== Preparing database =="
  system! 'bin/rails db:setup'
<% end -%>

  puts "\n== Removing old logs and tempfiles =="
  system! 'bin/rails log:clear tmp:clear'

  puts "\n== Restarting application server =="
  system! 'bin/rails restart'
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
railties-5.1.0.rc1 lib/rails/generators/rails/app/templates/bin/setup.tt
railties-5.1.0.beta1 lib/rails/generators/rails/app/templates/bin/setup.tt