From 0fdd7447d290897a6683a472d69d6eb085b83482 Mon Sep 17 00:00:00 2001 From: dan-mm Date: Thu, 28 Sep 2023 16:30:25 +0200 Subject: [PATCH] removed ascii_graph_path line as that was what was causing issues; fixed pythong previous_env logic to work with unbound variables --- scripts/setup.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/setup.sh b/scripts/setup.sh index 519184c6..4e4a55af 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -24,9 +24,7 @@ function initialize { # the other solution would be to set the environment variable `go env -w GO111MODULE=auto`... but I can't seem to get any already-set value ahead of time reliably, and do not want to overwrite # any user environment settings. # So, we ignore this error for now, as functionally the asciigraph still is installed and works for Eco-CI - go install github.com/guptarohit/asciigraph/cmd/asciigraph@latest || true - ascii_graph_path=$(go list -f '{{.Target}}' github.com/guptarohit/asciigraph/cmd/asciigraph) || true - echo $ascii_graph_path + go install github.com/guptarohit/asciigraph/cmd/asciigraph@latest fi # check for gcc @@ -46,8 +44,11 @@ function setup_python { # Create a venv, and backup old python3 -m venv /tmp/eco-ci/venv - if [[ $VIRTUAL_ENV != '' ]]; then - $PREVIOUS_VENV=$VIRTUAL_ENV + VENV_VALUE=${VIRTUAL_ENV:-} + PREVIOUS_VENV='' + + if [[ $VENV_VALUE != '' ]]; then + PREVIOUS_VENV=$VENV_VALUE source "$(dirname "$0")/vars.sh" add_var PREVIOUS_VENV $PREVIOUS_VENV fi