Permalink
Browse files

Adding the option to determine the environment during sitesetup

  • Loading branch information...
beaucollins committed Nov 24, 2009
1 parent a16c041 commit 6db694821a9a31c49df3eb39d932df3156103838
Showing with 7 additions and 1 deletion.
  1. +7 −1 bin/sitesetup
View
@@ -5,7 +5,8 @@ require 'optparse'
options = {
:directory => '/etc/apache2/sites-available',
:host => false,
- :force => false
+ :force => false,
+ :environment => 'development'
}
OptionParser.new do |opts|
opts.banner = "Usage: #{__FILE__} domain path [options]"
@@ -21,6 +22,10 @@ OptionParser.new do |opts|
opts.on("-H", "--host [HOST]", "Add host to /etc/hosts") do |h|
options[:host] = h
end
+
+ opts.on("-e", '--environment [ENVIRONMENT]', 'run Passenger under this environment (default: development)') do |e|
+ options[:environment] = e
+ end
end.parse!
@@ -54,6 +59,7 @@ begin
ServerName #{domain}
DocumentRoot "#{site_root}"
<Directory "#{site_root}">
+ RailsEnv #{options[:environment]}
Options Indexes MultiViews
AllowOverride None
Order allow,deny

0 comments on commit 6db6948

Please sign in to comment.