Environment specific Behavior

ddollar edited this page Jan 4, 2012 · 1 revision

If you'd like to control a command based on environment (e.g. only run certain commands in development or run different commands in development/production) you can use a wrapper script:

#!/bin/bash

if [ "$RACK_ENV" == "development" ]; then
  exec bundle exec shotgun -p $PORT
else
  exec bundle exec thin start -p $PORT -e $RACK_ENV
fi