Skip to content

Instantly share code, notes, and snippets.

@grahamannett
Created January 31, 2025 04:24
Show Gist options
  • Select an option

  • Save grahamannett/1ac2441613ed0187e14e07fc01d48c5b to your computer and use it in GitHub Desktop.

Select an option

Save grahamannett/1ac2441613ed0187e14e07fc01d48c5b to your computer and use it in GitHub Desktop.
# one line function for activating/deactivating venv in bash without having to install any other tools
# only meant to keep on hand for copy+pasting into bashrc when using normal dotfiles is not ideal, for better version in fish see: https://github.com/grahamannett/graham.fish-plugins/blob/main/functions/avenv.fish
function avenv() { if [[ $(type -t deactivate) == function ]]; then deactivate; elif [ -e .venv/bin/activate ]; then source .venv/bin/activate; fi }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment