Created
June 17, 2021 23:22
-
-
Save jaredcwhite/95271eacaf6a6bac2225959dab162e70 to your computer and use it in GitHub Desktop.
Switch RAILS_ENV based on the presence of a dot file
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
load-rails-env() { | |
if [ -f ".rails_env" ]; then | |
export RAILS_ENV=$(cat .rails_env) | |
else | |
export RAILS_ENV=production | |
fi | |
} | |
add-zsh-hook chpwd load-rails-env | |
load-rails-env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment