Skip to content

Instantly share code, notes, and snippets.

@chrislwade
Created March 21, 2011 04:40
Show Gist options
  • Save chrislwade/879044 to your computer and use it in GitHub Desktop.
Save chrislwade/879044 to your computer and use it in GitHub Desktop.
This function wraps the Redcar launcher to set different options based on the current directory. I use this to detect when I'm working on Redcar itself or a plugin for Redcar and launching with debug log output redirected to STDOUT. Otherwise I launch
function redcar {
if [ -f plugin.rb ]; then
echo "Found 'plugin.rb'!"
echo "Assuming this directory is a Redcar plugin."
echo "Running with --show-log, --log-level=debug, and without --fork."
wrapped_redcar --show-log --log-level=debug $*
elif [ -f lib/redcar.rb ] && [ -f bin/redcar ]; then
echo "Found 'lib/redcar.rb' and 'bin/redcar'!"
echo "Assuming this is the Redcar application directory."
echo "Running with --show-log, --log-level=debug, and without --fork."
wrapped_redcar --show-log --log-level=debug $*
else
wrapped_redcar --fork $* &> $HOME/.redcar/redcar.log
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment