Created
November 29, 2010 21:05
-
-
Save unicornrainbow/720619 to your computer and use it in GitHub Desktop.
This file contains 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
# Functions to start rails server, run generate open console | |
rails-server () { | |
if [ -e script/rails ]; then | |
rails server $* | |
elif [ -e script/server ]; then | |
./script/server $* | |
else | |
echo "Error: Not a rails app." | |
fi | |
} | |
rails-console () { | |
if [ -e script/rails ]; then | |
rails console $* | |
elif [ -e script/console ]; then | |
./script/console $* | |
else | |
echo "Error: Not a rails app." | |
fi | |
} | |
rails-generate () { | |
if [ -e script/rails ]; then | |
rails generate $* | |
elif [ -e script/generate ]; then | |
./script/generate $* | |
else | |
echo "Error: Not a rails app." | |
fi | |
} | |
rails-about () { | |
if [ -e script/rails ]; then | |
rails about $* | |
elif [ -e script/about ]; then | |
./script/about $* | |
else | |
echo "Error: Not a rails app." | |
fi | |
} | |
rails-dbconsole () { | |
if [ -e script/rails ]; then | |
rails dbconsole $* | |
elif [ -e script/dbconsole ]; then | |
./script/dbconsole $* | |
else | |
echo "Error: Not a rails app." | |
fi | |
} | |
rails-performance () { | |
if [ -e script/rails ]; then | |
rails performance $* | |
elif [ -e script/performance ]; then | |
./script/performance $* | |
else | |
echo "Error: Not a rails app." | |
fi | |
} | |
rails-process () { | |
if [ -e script/rails ]; then | |
rails process $* | |
elif [ -e script/process ]; then | |
./script/process $* | |
else | |
echo "Error: Not a rails app." | |
fi | |
} | |
rails-destroy () { | |
if [ -e script/rails ]; then | |
rails destroy $* | |
elif [ -e script/destroy ]; then | |
./script/destroy $* | |
else | |
echo "Error: Not a rails app." | |
fi | |
} | |
rails-plugin () { | |
if [ -e script/rails ]; then | |
rails plugin $* | |
elif [ -e script/plugin ]; then | |
./script/plugin $* | |
else | |
echo "Error: Not a rails app." | |
fi | |
} | |
rails-runner () { | |
if [ -e script/rails ]; then | |
rails runner $* | |
elif [ -e script/runner ]; then | |
./script/runner $* | |
else | |
echo "Error: Not a rails app." | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment