diff --git a/.oh-my-zsh/tools/workon.py b/.oh-my-zsh/tools/workon.py index dad072d..116c93f 100755 --- a/.oh-my-zsh/tools/workon.py +++ b/.oh-my-zsh/tools/workon.py @@ -7,7 +7,7 @@ import sys def find_above(*names): """Attempt to locate a .workon file by searching parent dirs.""" - + path = '.' while os.path.split(os.path.abspath(path))[1]: @@ -19,11 +19,11 @@ def find_above(*names): if __name__ == '__main__': - + wo_file = find_above('.workon') if wo_file and not 'VIRTUAL_ENV' in os.environ.keys(): with open(wo_file) as f: - print('source {0}/bin/activate'.format(f.read())) - + print('source {0}/bin/activate'.format(f.readlines()[0])) + elif not wo_file and 'VIRTUAL_ENV' in os.environ.keys(): print('deactivate')