From 69fee6855db6919bb1ec5126a9b5e7a47322b0f8 Mon Sep 17 00:00:00 2001 From: Yamashita Yuu Date: Sat, 27 Jun 2015 02:16:41 +0900 Subject: [PATCH] Show error message if the source version is not installed (#83) --- bin/pyenv-virtualenv | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/pyenv-virtualenv b/bin/pyenv-virtualenv index c26277c..146e671 100755 --- a/bin/pyenv-virtualenv +++ b/bin/pyenv-virtualenv @@ -282,7 +282,10 @@ fi export PYENV_VERSION="${VERSION_NAME}" # Source version must exist before creating virtualenv. -pyenv-prefix 1>/dev/null 2>&1 || usage 1 +if ! pyenv-prefix 1>/dev/null 2>&1; then + echo "pyenv-virtualenv: \`${PYENV_VERSION}' is not installed in pyenv." 1>&2 + exit 1 +fi if [ -z "$TMPDIR" ]; then TMP="/tmp"