aboutsummaryrefslogtreecommitdiffstats
path: root/railties/bin/rails
blob: 6a0c675206c53585ec766ba3fb5a8cc818fe7e47 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require File.dirname(__FILE__) + '/../lib/ruby_version_check'
Signal.trap("INT") { puts; exit }

require File.dirname(__FILE__) + '/../lib/rails/version'
if %w(--version -v).include? ARGV.first
  puts "Rails #{Rails::VERSION::STRING}"
  exit(0)
end

freeze   = ARGV.any? { |option| %w(--freeze -f).include?(option) }

app_path = ARGV.first

require File.dirname(__FILE__) + '/../lib/rails_generator'

require 'rails_generator/scripts/generate'
Rails::Generator::Base.use_application_sources!
Rails::Generator::Scripts::Generate.new.run(ARGV, :generator => 'app')

Dir.chdir(app_path) { `rake rails:freeze:gems`; puts "froze" } if freeze