grzegorz-clients/.envrc

22 lines
541 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
# This file is loaded with `direnv`.
# It enters you into the poetry venv, removing the need for `poetry run`.
2023-08-17 21:45:27 +02:00
if command -v nix >/dev/null; then
2024-03-31 04:45:22 +02:00
use flake || use nix -p poetry
2023-08-17 21:45:27 +02:00
fi
# Instead of using the flake, we use poetry to manage a development venv
# We only use poetry2nix for deployment
# create venv if it doesn't exist
poetry run true
# enter venv
export VIRTUAL_ENV=$(poetry env info --path)
export POETRY_ACTIVE=1
PATH_add "$VIRTUAL_ENV/bin"
2023-08-17 21:45:27 +02:00
if ! command -v sanic >/dev/null; then
poetry install
fi