From dc7b6abfde3fb322cd716c787a3752359d8c440b Mon Sep 17 00:00:00 2001 From: Yamashita Yuu Date: Sat, 18 Jan 2014 18:00:59 +0900 Subject: [PATCH] Display messages only on verbose mode --- bin/pyenv-virtualenv | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/bin/pyenv-virtualenv b/bin/pyenv-virtualenv index 6909b17..e820de2 100755 --- a/bin/pyenv-virtualenv +++ b/bin/pyenv-virtualenv @@ -131,7 +131,9 @@ venv() { install_setuptools() { local version="$1" { if [ "${EZ_SETUP+defined}" ] && [ -f "${EZ_SETUP}" ]; then - echo "Installing setuptools from ${EZ_SETUP}..." 1>&2 + if [ -n "$VERBOSE" ]; then + echo "Installing setuptools from ${EZ_SETUP}..." 1>&2 + fi cat "${EZ_SETUP}" else [ -n "${EZ_SETUP_URL}" ] || { @@ -141,7 +143,9 @@ install_setuptools() { EZ_SETUP_URL="https://bitbucket.org/pypa/setuptools/downloads/ez_setup.py" fi } - echo "Installing setuptools from ${EZ_SETUP_URL}..." 1>&2 + if [ -n "$VERBOSE" ]; then + echo "Installing setuptools from ${EZ_SETUP_URL}..." 1>&2 + fi http get "${EZ_SETUP_URL}" fi } | PYENV_VERSION="${version}" pyenv-exec python @@ -150,7 +154,9 @@ install_setuptools() { install_pip() { local version="$1" { if [ "${GET_PIP+defined}" ] && [ -f "${GET_PIP}" ]; then - echo "Installing pip from ${GET_PIP}..." 1>&2 + if [ -n "$VERBOSE" ]; then + echo "Installing pip from ${GET_PIP}..." 1>&2 + fi cat "${GET_PIP}" else [ -n "${GET_PIP_URL}" ] || { @@ -160,7 +166,9 @@ install_pip() { GET_PIP_URL="https://raw.github.com/pypa/pip/master/contrib/get-pip.py" fi } - echo "Installing pip from ${GET_PIP_URL}..." 1>&2 + if [ -n "$VERBOSE" ]; then + echo "Installing pip from ${GET_PIP_URL}..." 1>&2 + fi http get "${GET_PIP_URL}" fi } | PYENV_VERSION="${version}" pyenv-exec python