Created
June 26, 2018 17:01
-
-
Save sardaukar/b19fdf959470f9e7d07158b7f7e7f930 to your computer and use it in GitHub Desktop.
.envrc multi-env
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
context= | |
[[ -f .envrc.context ]] && context=$(< .envrc.context) | |
watch_file ".envrc.context" | |
RED='\033[0;31m' | |
LBLUE='\033[1;34m' | |
NC='\033[0m' | |
if [[ -n "$context" ]]; then | |
context_file=".envrc.$context" | |
if [[ -f "$context_file" ]]; then | |
echo -e "Loading ${LBLUE}$context${NC} context\n" | |
source_env "$context_file" | |
else | |
echo "$context_file missing" | |
fi | |
fi |
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
development |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment