From 67d6cfc0d20f91ad6a944565155c9c3ea66ac53f Mon Sep 17 00:00:00 2001 From: Yamashita Yuu Date: Mon, 27 May 2013 23:50:13 +0900 Subject: [PATCH] handle `--force` option expectedly --- bin/pyenv-virtualenv | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/pyenv-virtualenv b/bin/pyenv-virtualenv index b37f59d..8e75a0e 100755 --- a/bin/pyenv-virtualenv +++ b/bin/pyenv-virtualenv @@ -2,10 +2,12 @@ # # Summary: Create a Python virtualenv using the pyenv-virtualenv plugin # -# Usage: pyenv virtualenv [VIRTUALENV_OPTIONS] +# Usage: pyenv virtualenv [-f|--force] [VIRTUALENV_OPTIONS] # pyenv virtualenv --version # pyenv virtualenv --help # +# -f/--force Install even if the version appears to be installed already +# PYENV_VIRTUALENV_VERSION="20130527" VIRTUALENV_VERSION="${VIRTUALENV_VERSION:-1.9.1}" @@ -133,6 +135,7 @@ ensure_virtualenv "${VIRTUALENV}" "${VIRTUALENV_URL}" || { exit 1 } +unset FORCE # Unset environment variables which starts with `VIRTUALENV_`. # These variables are reserved for virtualenv. unset VIRTUALENV_VERSION @@ -140,6 +143,9 @@ unset VIRTUALENV_VERSION parse_options "$@" for option in "${OPTIONS[@]}"; do case "$option" in + "f" | "force" ) + FORCE=true + ;; "h" | "help" ) usage 0 ;;