travis2bash argument fix

- also minor code quality
pull/1/head
Peter Šurda 2 years ago
parent 456a458e86
commit be2aadb276
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87
  1. 9
      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

Loading…
Cancel
Save