Created
August 26, 2024 09:53
-
-
Save VictorGob/0e59d72f8fc96e589fae945526e37cab to your computer and use it in GitHub Desktop.
Alias to check that the local environment is activated, if not, activate it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment