Skip to content

Commit

Permalink
Merge pull request porterjamesj#67 from vzell/customize-virtualenv
Browse files Browse the repository at this point in the history
Make the virtualenv command customizable
  • Loading branch information
porterjamesj committed Feb 23, 2019
2 parents 49e3219 + 0404678 commit f753e5a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions virtualenvwrapper.el
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
"Virtualenvwrapper for Emacs."
:group 'python)

(defcustom venv-virtualenv-command "virtualenv"
"The command to use to run virtualenv."
:type '(string)
:group 'virtualenvwrapper)

(defcustom venv-location
(expand-file-name (or (getenv "WORKON_HOME") "~/.virtualenvs/"))
"The location(s) of your virtualenvs. This
Expand Down Expand Up @@ -330,7 +335,7 @@ identifying a virtualenv."
(defun venv--check-executable ()
"Verify that there is a virtualenv executable available,
throwing an error if not"
(unless (executable-find "virtualenv")
(unless (executable-find venv-virtualenv-command)
(error "There doesn't appear to be a virtualenv executable on
your exec path. Ensure that you have virtualenv installed and
that the exec-path variable is set such that virtualenv can
Expand Down Expand Up @@ -368,7 +373,7 @@ current `default-directory'."
(when (-contains? (venv-get-candidates) it)
(error "A virtualenv with this name already exists!"))
(run-hooks 'venv-premkvirtualenv-hook)
(shell-command (concat "virtualenv " python-exe-arg " " parent-dir it))
(shell-command (concat venv-virtualenv-command " " python-exe-arg " " parent-dir it))
(when (listp venv-location)
(add-to-list 'venv-location (concat parent-dir it)))
(venv-with-virtualenv it
Expand Down

0 comments on commit f753e5a

Please sign in to comment.