Skip to content

Instantly share code, notes, and snippets.

Avatar

Éloi Rivard azmeuk

View GitHub Profile
View .bashrc
#
# Finds the closest virtualenv root directory, starting from $1, and going up to the root.
# If the target directory is not specified as an argument, current directory is used.
# Prints the virtualenv path found, or nothing otherwise.
#
function venv_find () {
# The cycle is just for the case with broken root folder detection -- never do more than N iterations.
venv_root=${1:-"."}
venv_found=""