1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-12-21 03:41:57 +00:00
Commit graph

35 commits

Author SHA1 Message Date
vladislav doster
1d09c6bb0a
style: remove trailing whitespace (#12303) 2024-03-26 09:55:16 +01:00
Júlio Selva
d43f03ba91
feat(virtualenvwrapper): run function on startup (#12163) 2024-01-18 19:34:30 +01:00
Zachary Cutlip
1e615b71d6
fix(virtualenvwrapper): only deactivate if virtual env is still present (#10671) 2022-02-10 16:25:23 +01:00
Dom Sekotill
94ea7b4516
fix(virtualenvwrapper): several changes for checking git directory, including fixes (#5663)
* Test only for the presence of a .git directory in virtualenvwrapper

Instead of using both $(git rev-parse --show-toplevel) and a check for
a .git directory, use just the latter. As well as being redundant
the former does not work quite so well when using multiple worktrees;
each worktree will be treated as a separate project.

* Unset ENV_NAME & deactivate if no virtualenv found

This addresses #4603 without breaking current behaviour (where current
behaviour is correct).

When changing directories, if there is no environment matching
ENV_NAME, ENV_NAME is emptied and deactivate called if there is a
current environment active (based on CD_VIRTUAL_ENV).

* Use path comparison not string comparison for paths

This will solve part of issue #4255 where WORKON_HOME is defined with a
trailing slash or not normalised in some way, as well as instances
where symlinks are used, and any other instances where constructed
paths don't exactly match even though they go to the same file.

Co-authored-by: Robby Russell <robby@planetargon.com>
2021-06-11 20:52:22 -07:00
Marc Cornellà
68d51bd7d8 virtualenvwrapper: fix load and detection logic 2020-05-26 18:05:11 +02:00
Hector S
fe97382bc1
virtualenvwrapper: look in $HOME/.local/bin directory (#8758) 2020-03-22 13:43:58 +01:00
Alastair Rankine
e81782ac3f
virtualenvwrapper: rewrite init script location code (#8521) 2020-02-07 12:06:06 +01:00
Jimmy Merrild Krag
4e45e12dc3 virtualenvwrapper: fix finding script on Ubuntu 19.10 (#8451) 2020-01-19 20:42:45 +01:00
Jay Tavares
1a0500b00d Change order of automatic virtualenv activation/deactivation (#6687)
When navigating from a virtualenv project directory, first deactivate the virtualenv.
Then, check to see if destination directory is also a virtualenv project directory.
If it is activate that virtualenv. See #5817.
2019-12-20 21:08:03 -08:00
Jacob Tomaw
1ba0af650a Use safer append to hook function arrays (#8406)
Use add-zsh-hook to add functions to hooks. That way they won't be added again
when doing `source ~/.zshrc` multiple times.

Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2019-11-19 18:47:12 +01:00
Michael C
5efe52d991 virtualenvwrapper: add README (#8226) 2019-10-07 18:04:49 +02:00
Marc Cornellà
f461d21de1
virtualenvwrapper: set $WORKON_HOME if undefined
This uses the default that virtualenvwrapper.sh would set if it was called. If the user
changes its value after the plugin is loaded, the plugin will work all the same.

Fixes #6882
Closes #6870
Closes #6883
2018-06-06 17:14:19 +02:00
Lorenzo Bolla
90a5bd06ca Prefer virtualenvwrapper_lazy (#6842)
This gives much faster start up times and only loads virtualenvwrapper
when needed.

Fix #6839
2018-05-26 20:44:49 +02:00
Ian Chesal
0c63909ad3 Fix default location of the virtualenvwrapper script (#6348)
The `virtualenvwrapper` script has been relocated to
`/usr/local/bin/virtualenvwrapper.sh`. Update the
plugin to look in the new location first. See:

http://virtualenvwrapper.readthedocs.io/en/latest/#introduction

to confirm the change in location for this script.

This addresses issue #3047 where the solution was to source this file
from your zshrc.
2018-05-13 21:56:46 +02:00
Marc Cornellà
ccb0ae5720 Add quotes to support folders with whitespace 2015-08-07 22:45:46 +02:00
Andrew Janke
f73e642e22 virtualenvwrapper: treat git repos as project roots again (instead of requiring a .venv customization directory)
Change error output to more conventional OMZ format, so it's clear the plugin is for oh-my-zsh and not base zsh.
Use `local` variables instead of manual unsetting.
2015-07-02 21:57:15 -04:00
Andrew Janke
c1f1f91daa virtualenvwrapper: Replace "realpath" with portable zsh-native :A and :h modifiers 2015-06-29 18:55:58 -04:00
Robby Russell
0a8ca6adff Merge pull request #3918 from cbazin/master
Detect the .venv in any parent directory of the current directory
2015-06-14 22:19:23 -07:00
Tommy Wang
d0b690b584 use local options to set no_equals before sourcing bash completion script 2015-06-13 10:57:31 +02:00
epelletier
7b478d75a3 Detect the .venv in any parent directory of the current directory 2015-05-21 17:34:24 +02:00
Marc Cornellà
732c7b8070 Simplify adding workon_cwd to chpwd hook 2015-02-10 20:32:52 +01:00
Marc Cornellà
b62911660d Organize error checking in virtualenwrapper plugin 2015-02-10 20:32:52 +01:00
Brandon Sandrowicz
4161aa4f9d Fixing virtualenvwrapper plugin for Ubuntu (and Debian)
Ubuntu and Debian store the system-installed virtualenvwrapper in
/etc/bash_completion.d/virtualenvwrapper, so that it gets automatically sourced
at startup in Bash. By not putting it somewhere in $PATH, they end up excluding
others (e.g. Zsh) that might want to use that file. Oops!

The virtualenvwrapper plugin should account for this so that Ubuntu (or Debian)
users don't end up with this message:

zsh virtualenvwrapper plugin: Cannot find virtualenvwrapper.sh. Please install with `pip install virtualenvwrapper`.

even when they have a virtualenvwrapper installed to a known location.
2015-02-10 20:32:52 +01:00
Jyrki Pulliainen
833e6f5958 virtualenvwrapper: Deactivate only if in virtualenv
If user manually deactivates the virtualenv when using this mode, zsh
will produce following error:

    deactivate:12: command not found: virtualenv_deactivate

To avoid this, check that the VIRTUAL_ENV flag is set before trying to
automatically deactivate the virtual environment.

Fixes #2185
2015-01-07 18:17:29 +01:00
benjaoming
4b05e548d0 Throw an error message when $WORKON_HOME is not set
Took me a while to figure this one out, and I have a default installation of virtualenvwrapper -- this is a soft fix, just put an error message. But perhaps the fix should be to use the default value `~/.virtualenvs`.
2014-11-28 14:41:34 +01:00
Felix Laurie von Massenbach
3be2e34d96 Don't lazy load the virtualenvwrapper.
Fix robbyrussell#2355.
2014-03-17 02:17:30 +00:00
Lei Zhang
c0c9fc0254 Add support .venv folder as virtual env 2013-10-16 15:50:52 +08:00
Andrew Grangaard
e73dd2cdf8 virtualenvwrapper plugin cleanup
* removes cd override by using chpwd_functions
* removes subshell call to which by using $+commands array and
  c param expansion to find in PATH
* zsh love!
2013-06-08 11:36:14 -07:00
Germán M. Bravo
69116fa806 Fixed recursion. Git not needed for it to work.
Avoid infinite `cd` loops under certain conditions. Try getting `.venv` from the current directory (not necessarily always using git)
2013-05-21 14:20:28 -04:00
J. Randall Hunt
b9d5a39098 use lazy load for virtualenvwrapper
Using lazy loading for virtualenvwrapper gives a mariginal speed
improvement and doesn't stop workon_cd from working. It has the
undesired effect of forcing you to call certain virtualenv commands
twice before they work (only once per shell instantiation).
2012-12-02 16:40:40 -05:00
Cenk Alti
d5e5b7ee5a search virtualenvwrapper.sh in PATH 2012-08-25 10:27:05 +03:00
Cenk Alti
6f92745761 Added another path for virtualenvwrapper plugin
When you install python via brew on OSX, pip is installed into /usr/local/share/python/ and all packages installed with this pip are installed here.
2012-08-25 09:51:58 +03:00
David Barragan
d15ec4bf24 Added another path 2012-06-25 10:55:23 +02:00
James Walker
82f785bc67 remove readlink call and clean up 2012-06-18 10:41:19 -04:00
Jaiden Mispy
61ceec5285 Plugin which loads Python virtualenvwrapper and activates virtualenvs on cd into git repos 2012-06-09 11:04:58 +10:00