Skip to content

Commit

Permalink
feat(.envrc): add bash script for setting project environment variabl…
Browse files Browse the repository at this point in the history
…es and virtual environment setup
  • Loading branch information
entelecheia committed Sep 3, 2023
1 parent 71f607e commit 7ff700e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
export PYTHON_KEYRING_BACKEND="keyring.backends.null.Keyring"
export PROJECT_NAME="dotfiles"
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export PROJECT_ROOT
VIRTUAL_ENV="${WORKON_HOME}/${PROJECT_NAME}"
if [ -e "${VIRTUAL_ENV}/bin/activate" ]; then
# shellcheck disable=SC1091
source "${VIRTUAL_ENV}/bin/activate"
else
python3 -m venv "${VIRTUAL_ENV}"
# shellcheck disable=SC1091
source "${VIRTUAL_ENV}/bin/activate"
pip install --upgrade pip setuptools wheel
fi

0 comments on commit 7ff700e

Please sign in to comment.