feat: Direnv w/ poetry
This commit is contained in:
parent
710f9f3b13
commit
999152c9de
15
.config/direnv/direnvrc
Normal file
15
.config/direnv/direnvrc
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/zsh
|
||||
|
||||
layout_poetry() {
|
||||
if [[ ! -f pyproject.toml ]]; then
|
||||
log_error 'No pyproject.toml found. Use `poetry new` or `poetry init` to create one first.'
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# create venv if it doesn't exist
|
||||
poetry run true
|
||||
|
||||
export VIRTUAL_ENV=$(poetry env info --path)
|
||||
export POETRY_ACTIVE=1
|
||||
PATH_add "$VIRTUAL_ENV/bin"
|
||||
}
|
Loading…
Reference in New Issue
Block a user