Permalink
Browse files

Rename script/setup to bin/setup

This will be the Rails 4 recommendation:

rails/rails@009873a

* Include `-e $RACK_ENV` in `Procfile` per Heroku docs.
* Make bin/setup idempotent by only copying `.sample.env` to `.env` if
  `.env` file does not exist yet. Prevent users from accidentally
  overwriting the file, which is not kept in version control.
* Change `sample.env` to a `.sample.env` so it shows less often.
  • Loading branch information...
1 parent d5691cf commit 1ebc5a77896c04926bcf1c8191f21887056fc496 @croaky croaky committed Jan 2, 2013
Showing with 8 additions and 5 deletions.
  1. +3 −3 lib/suspenders/app_builder.rb
  2. +1 −1 templates/Procfile
  3. +4 −1 templates/{script_setup → bin_setup}
@@ -20,8 +20,8 @@ def raise_delivery_errors
end
def provide_setup_script
- copy_file 'script_setup', 'script/setup'
- run 'chmod a+x script/setup'
+ copy_file 'bin_setup', 'bin/setup'
+ run 'chmod a+x bin/setup'
end
def enable_factory_girl_syntax
@@ -181,7 +181,7 @@ def generate_clearance
end
def setup_foreman
- copy_file 'sample.env', 'sample.env'
+ copy_file 'sample.env', '.sample.env'
copy_file 'Procfile', 'Procfile'
end
View
@@ -1 +1 @@
-web: bundle exec rails server thin -p $PORT
+web: bundle exec rails server thin -p $PORT -e $RACK_ENV
@@ -5,4 +5,7 @@
bundle install --binstubs=bin/stubs
bundle exec rake db:setup
-cp sample.env .env
+
+if [ ! -f .env ]; then
+ cp .sample.env .env
+fi

0 comments on commit 1ebc5a7

Please sign in to comment.