Skip to content

Instantly share code, notes, and snippets.

@justinfrench
Created August 14, 2012 10:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinfrench/3348009 to your computer and use it in GitHub Desktop.
Save justinfrench/3348009 to your computer and use it in GitHub Desktop.
Run either foreman, `rails server` (Rails 3) or `script/server` (Rails 2) based what's in the file system
function s()
{
# Look for a .env file, run foreman with -p 3000 for consistency
if [ -e ".env" ]
then
foreman start -p 3000
# Look for "script/rails" (Rails 3)
elif [ -e "script/rails" ]
then
script/rails server
# Faillback to Rails 2
else
script/server
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment