Tries to find and activate a virtual environment either in the current directory or the closest one in the hierarchy.
Example:
- in
/foo/bar/baz - first, checks if
/foo/bar/baz/venv/bin/activateis found (and uses that if it is) - next, tries
/foo/bar/venv/bin/activate - after that,
/foo/venv/bin/activate - if that was not found, outputs an error message
Note: you need to run the script with source (or .), i.e. source activate-env.sh for the environment activation to work.