From 3d3ec182d7f730b8cc4760b7d4cc70ed01a1a36a Mon Sep 17 00:00:00 2001 From: "Fabio C. Barrioneuvo da Luz" Date: Wed, 23 Mar 2016 17:38:43 -0300 Subject: [PATCH] fix issue #508 --- CHANGELOG.md | 1 + .../install_python_dependencies.sh | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa105ada..cb89f6ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### [2016-03-23] ### Changed - Fixed issue on LICENSE file generation (@romanosipenko) +- In install_python_dependencies.sh file, Fixed wrong reference to python3 if use_python2 was set to y (@luzfcb @noisy) ### [2016-03-16] ### Changed diff --git a/{{cookiecutter.repo_name}}/install_python_dependencies.sh b/{{cookiecutter.repo_name}}/install_python_dependencies.sh index 34929e60..027004d7 100755 --- a/{{cookiecutter.repo_name}}/install_python_dependencies.sh +++ b/{{cookiecutter.repo_name}}/install_python_dependencies.sh @@ -3,7 +3,11 @@ pip --version >/dev/null 2>&1 || { echo >&2 -e "\npip is required but it's not installed." echo >&2 -e "You can install it by running the following command:\n" +{% if cookiecutter.use_python2 == 'n' -%} echo >&2 "wget https://bootstrap.pypa.io/get-pip.py --output-document=get-pip.py; chmod +x get-pip.py; sudo -H python3 get-pip.py" +{% else %} + echo >&2 "wget https://bootstrap.pypa.io/get-pip.py --output-document=get-pip.py; chmod +x get-pip.py; sudo -H python2 get-pip.py" +{%- endif %} echo >&2 -e "\n" echo >&2 -e "\nFor more information, see pip documentation: https://pip.pypa.io/en/latest/" exit 1; @@ -12,7 +16,11 @@ pip --version >/dev/null 2>&1 || { virtualenv --version >/dev/null 2>&1 || { echo >&2 -e "\nvirtualenv is required but it's not installed." echo >&2 -e "You can install it by running the following command:\n" +{% if cookiecutter.use_python2 == 'n' -%} echo >&2 "sudo -H pip3 install virtualenv" +{% else %} + echo >&2 "sudo -H pip2 install virtualenv" +{%- endif %} echo >&2 -e "\n" echo >&2 -e "\nFor more information, see virtualenv documentation: https://virtualenv.pypa.io/en/latest/" exit 1; @@ -21,7 +29,11 @@ virtualenv --version >/dev/null 2>&1 || { if [ -z "$VIRTUAL_ENV" ]; then echo >&2 -e "\nYou need activate a virtualenv first" echo >&2 -e 'If you do not have a virtualenv created, run the following command to create and automatically activate a new virtualenv named "venv" on current folder:\n' +{% if cookiecutter.use_python2 == 'n' -%} echo >&2 -e "virtualenv venv --python=\`which python3\`" +{% else %} + echo >&2 -e "virtualenv venv --python=\`which python2\`" +{%- endif %} echo >&2 -e "\nTo leave/disable the currently active virtualenv, run the following command:\n" echo >&2 "deactivate" echo >&2 -e "\nTo activate the virtualenv again, run the following command:\n" @@ -35,3 +47,4 @@ else pip install -r requirements/test.txt pip install -r requirements.txt fi +