From be2aadb276175f314186ca5d49a31e5a9178ee3c Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Sun, 14 Feb 2021 11:52:33 +0100 Subject: [PATCH] travis2bash argument fix - also minor code quality --- travis2bash.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/travis2bash.sh b/travis2bash.sh index 1a3ec72..7cf06bd 100755 --- a/travis2bash.sh +++ b/travis2bash.sh @@ -80,9 +80,12 @@ function aptinstall() { function virtualenv_init() { # init virtualenv directory - if [ -n "$1" ] && [ -n "$2" ]; then - echo -e "\nvirtualenv -p \"$1\" ~/.venv-$2\n" + if [ -n "$3" ]; then + echo -e "\nvirtualenv -p \"$1\" \"$3\" ~/.venv-$2\n" virtualenv -p "$1" "$3" ~/.venv-"$2" + elif [ -n "$2" ]; then + echo -e "\nvirtualenv -p \"$1\" ~/.venv-$2\n" + virtualenv -p "$1" ~/.venv-"$2" else echo -e "\nvirtualenv ~/.venv\n" virtualenv ~/.venv @@ -94,7 +97,7 @@ function virtualenv_activate() { # shellcheck disable=SC1090 if [ -n "$1" ]; then echo -e "\n. ~/.venv-$1/bin/activate\n" - . ~/.venv-$1/bin/activate + . ~/.venv-"$1"/bin/activate else echo -e "\n. ~/.venv/bin/activate\n" . ~/.venv/bin/activate