From 16642779e3b94ab7ec4f0f30cd1d233c392461c1 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Mon, 30 Mar 2020 10:58:26 +0200 Subject: [PATCH] Fix cookiecutter Change-Id: I9beab1971cbeb77c081bac3bfdab4fcab9acdc6d --- contrib/bootstrap.sh | 20 ++++++++++---------- functions | 3 ++- puppet-{{cookiecutter.project_name}}/tox.ini | 7 ++++--- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/contrib/bootstrap.sh b/contrib/bootstrap.sh index 121925e..1602e8e 100644 --- a/contrib/bootstrap.sh +++ b/contrib/bootstrap.sh @@ -74,22 +74,22 @@ if [ -z "${testing}" ]; then else tmp_var="${PWD}/puppet-${proj}" cookiecutter_conf="${PWD}/default-config.yaml" - # https://github.com/audreyr/cookiecutter/pull/621 - if ! grep -q poyo /usr/lib/python2.7/site-packages/cookiecutter-*.egg-info/requires.txt; then - # Requires gcc - if [ -z "$(which gcc 2>/dev/null)" ]; then - echo "GCC is required to install cookiecutter." - exit 1 - fi - sudo pip install ruamel.yaml + set +e + which pip3 2>&1 + ret=$? + set -e + if [ $ret -eq 0 ]; then + pip_bin=pip3 + else + pip_bin=pip fi - sudo pip install cookiecutter==1.3.0 + sudo $pip_bin install cookiecutter==1.7.0 cat > "${cookiecutter_conf}" <