Skip to content

Instantly share code, notes, and snippets.

@joeyates
Created July 13, 2016 11:52
Show Gist options
  • Select an option

  • Save joeyates/6bb149988f3527ad1835caa4c878d84f to your computer and use it in GitHub Desktop.

Select an option

Save joeyates/6bb149988f3527ad1835caa4c878d84f to your computer and use it in GitHub Desktop.
# Set up a bash function to cd to a Rails app's current directory and set the prompt
rails_app ()
{
cd "$APP_PATH/current";
export PS1="(\$APP_NAME:\$RAILS_ENV)\w>"
}
my_rails_app ()
{
export APP_NAME=my_rails_app
export RAILS_ENV=production
export APP_PATH="/srv/my_rails_app"
rails_app
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment