Skip to content

Instantly share code, notes, and snippets.

View VictorGob's full-sized avatar

Víctor VictorGob

View GitHub Profile
@VictorGob
VictorGob / checkvenv_alias.env
Created August 26, 2024 09:53
Alias to check that the local environment is activated, if not, activate it.
alias checkvenv='if [ "$VIRTUAL_ENV" = "$(pwd)/.venv" ]; then echo -e "\033[0;32m*** VIRTUAL_ENV OK ***\033[0m"; else echo "VIRTUAL_ENV does not match current directory, activating local venv"; if [ -f ".venv/bin/activate" ]; then source .venv/bin/activate; else echo "No .venv found in current directory"; fi; fi'