From a1dfb3442a56f1516deae8e1b07f4374493254bc Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Sun, 14 Feb 2021 11:59:12 +0100 Subject: [PATCH] travis2bash python options fix --- travis2bash.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/travis2bash.sh b/travis2bash.sh index 7cf06bd..6c7f568 100755 --- a/travis2bash.sh +++ b/travis2bash.sh @@ -161,8 +161,10 @@ if [[ "$(declare -p travis_python)" =~ "declare -a" ]]; then # strip quotes temp="${pv%\"}" pv="${temp#\"}" - # strip crap options=$(echo "$pv"|cut -d_ -f2-) + if [ "$options" == "$pv" ]; then + unset options + fi if [[ "$options" == with* ]]; then options="--$(echo "$options"|cut -d_ -f2-|tr -- '_' '-')" fi @@ -176,7 +178,11 @@ if [[ "$(declare -p travis_python)" =~ "declare -a" ]]; then sudo apt -y install "python$pv" "python${pv}-dev" #fi - virtualenv_init "$ppath" "$pv" "$options" + if [ -n "$options" ]; then + virtualenv_init "$ppath" "$pv" "$options" + else + virtualenv_init "$ppath" "$pv" + fi virtualenv_activate "$pv" python_run "$ppath" "$pv" deactivate