Created
August 14, 2012 10:22
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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