]> git.openstreetmap.org Git - rails.git/blobdiff - bin/setup
Merge remote-tracking branch 'upstream/pull/5900'
[rails.git] / bin / setup
index b5accee8aca084a9d9d65a33eb4fd995f714eef4..b91b090efe77f383a1d118a5f3a5bfaeda2112ac 100755 (executable)
--- a/bin/setup
+++ b/bin/setup
@@ -1,11 +1,10 @@
 #!/usr/bin/env ruby
 require "fileutils"
 
-# path to your application root.
 APP_ROOT = File.expand_path("..", __dir__)
 
-def system!(*args)
-  system(*args, :exception => true)
+def system!(*)
+  system(*, :exception => true)
 end
 
 FileUtils.chdir APP_ROOT do
@@ -14,7 +13,6 @@ FileUtils.chdir APP_ROOT do
   # Add necessary setup steps to this file.
 
   puts "== Installing dependencies =="
-  system! "gem install bundler --conservative"
   system("bundle check") || system!("bundle install")
 
   # puts "\n== Copying sample files =="
@@ -28,6 +26,9 @@ FileUtils.chdir APP_ROOT do
   puts "\n== Removing old logs and tempfiles =="
   system! "bin/rails log:clear tmp:clear"
 
-  puts "\n== Restarting application server =="
-  system! "bin/rails restart"
+  unless ARGV.include?("--skip-server")
+    puts "\n== Starting development server =="
+    $stdout.flush # flush the output before exec(2) so that it displays
+    exec "bin/dev"
+  end
 end