File tree Expand file tree Collapse file tree 1 file changed +24
-7
lines changed Expand file tree Collapse file tree 1 file changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -93,23 +93,40 @@ export COMPOSE_PROJECT_NAME="SQL-scripts"
93
93
# export TF_VAR_cloudflare_api_key="$CLOUDFLARE_API_KEY" # must be a key, not a token using the link above
94
94
95
95
# ============================================================================ #
96
- # Python, AWS, GCP, Terraform
96
+ # P y t h o n , A W S , G C P , T e r r a f o r m
97
97
# ============================================================================ #
98
98
99
- # .envrc-aws \
100
- # .envrc-gcp \
101
- # .envrc-terraform \
102
- for envrc in \
103
- .envrc-python \
104
- ; do
99
+ load_if_exists (){
100
+ local envrc=" $1 "
105
101
if [ -f " $srcdir /$envrc " ]; then
106
102
echo
107
103
echo " Loading $srcdir /$envrc "
108
104
# shellcheck disable=SC1090,SC1091
109
105
. " $srcdir /$envrc "
110
106
fi
107
+ }
108
+
109
+ # .envrc-aws \
110
+ # .envrc-gcp \
111
+ # .envrc-terraform \
112
+ for envrc in \
113
+ .envrc-python \
114
+ ; do
115
+ load_if_exists " $envrc "
111
116
done
112
117
118
+ if [[ " $PWD " =~ /aws/ ]]; then
119
+ load_if_exists .envrc-aws
120
+ fi
121
+
122
+ if [[ " $PWD " =~ /gcp/ ]]; then
123
+ load_if_exists .envrc-gcp
124
+ fi
125
+
126
+ if [[ " $PWD " =~ /(terra(form)? | tf)(/| $) ]]; then
127
+ load_if_exists .envrc-terraform
128
+ fi
129
+
113
130
# ============================================================================ #
114
131
# K u b e r n e t e s
115
132
# ============================================================================ #
You can’t perform that action at this time.
0 commit comments