From 7ba6b759106ba0cc4fdc67c2277e398c3d407d75 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Tue, 20 May 2014 10:14:20 +0200 Subject: `bin/setup` script to bootstrap applications. --- .../rails/generators/rails/app/templates/bin/setup | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 railties/lib/rails/generators/rails/app/templates/bin/setup (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/rails/app/templates/bin/setup b/railties/lib/rails/generators/rails/app/templates/bin/setup new file mode 100644 index 0000000000..3d5f443406 --- /dev/null +++ b/railties/lib/rails/generators/rails/app/templates/bin/setup @@ -0,0 +1,28 @@ +require 'pathname' + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +Dir.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 install" + + # puts "\n== Copying sample files ==" + # unless File.exists?("config/database.yml") + # system "cp config/database.yml.sample config/database.yml" + # end + + puts "\n== Preparing database ==" + system "bin/rake db:setup" + + puts "\n== Removing old logs and tempfiles ==" + system "rm -f log/*" + system "rm -rf tmp/cache" + + puts "\n== Restarting application server ==" + system "touch tmp/restart.txt" +end -- cgit v1.2.3