Created
March 20, 2026 04:44
-
-
Save hed0rah/71356531dcd44ccf98ceb2c2f6aa6202 to your computer and use it in GitHub Desktop.
venv ez button
This file contains hidden or 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
| venv() { | |
| local d="${1:-.venv}" | |
| if [[ -d "$d" ]]; then | |
| source "$d/bin/activate" | |
| echo "activated $d ($(python --version), $(pip list 2>/dev/null | tail -n +3 | wc -l) packages)" | |
| else | |
| python3 -m venv "$d" && source "$d/bin/activate" | |
| echo "created & activated $d ($(python --version))" | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment