Skip to content

Commit 39a4591

Browse files
committed
added .envrc
1 parent a2d58fa commit 39a4591

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.envrc

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
# vim:ts=4:sts=4:sw=4:et
3+
#
4+
# Author: Hari Sekhon
5+
# Date: Mon Feb 22 17:42:01 2021 +0000
6+
#
7+
# https://github.com/HariSekhon/DevOps-Python-tools
8+
#
9+
# License: see accompanying Hari Sekhon LICENSE file
10+
#
11+
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
12+
#
13+
# https://www.linkedin.com/in/HariSekhon
14+
#
15+
16+
# ============================================================================ #
17+
# D i r e n v
18+
# ============================================================================ #
19+
20+
# .envrc to auto-load the virtualenv inside the 'venv' directory if present
21+
22+
# https://direnv.net/man/direnv-stdlib.1.html
23+
24+
# See more .envrc files in:
25+
#
26+
# https://github.com/HariSekhon/DevOps-Bash-tools
27+
#
28+
# .envrc-aws
29+
# .envrc-gcp
30+
# .envrc-kubernetes
31+
32+
set -euo pipefail
33+
[ -n "${DEBUG:-}" ] && set -x
34+
#srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
35+
36+
export COMPOSE_PROJECT_NAME="pytools"
37+
38+
venv="$PWD/venv"
39+
40+
if [ -f "$venv/bin/activate" ]; then
41+
echo
42+
echo "Local virtualenv directory found in: $venv"
43+
echo
44+
echo "Activating Virtualenv inside the directory: $venv"
45+
46+
# shellcheck disable=SC1091
47+
source "$venv/bin/activate"
48+
echo
49+
fi
50+
51+
# read .env too
52+
#dotenv

0 commit comments

Comments
 (0)