From a7d8298d550d6b87e6ad50a0d7c442b622436f5f Mon Sep 17 00:00:00 2001 From: Ivan Ogasawara Date: Thu, 20 Jun 2024 10:28:07 -0400 Subject: [PATCH] fix bash if condition --- tests/smoke/base.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/smoke/base.sh b/tests/smoke/base.sh index e0eaead7..fbd17739 100755 --- a/tests/smoke/base.sh +++ b/tests/smoke/base.sh @@ -6,7 +6,13 @@ PATH_ORI=${PATH} PWD_ORI=$(pwd) PROJECT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd ../.. && pwd )" -CONDA_PATH=$(ensureconda --conda-exe --no-install) +CONDA_PATH=$(ensureconda --conda --no-install | sed 's:/mamba$:/conda:') +MAMBA_PATH=$(ensureconda --mamba --no-install | sed 's:/conda$:/mamba:') + +if [[ ! -f "$MAMBA_PATH" ]]; then + echo "[EE] 'mamba' not found." + exit 1 +fi if [[ ! -f "$CONDA_PATH" ]]; then echo "[EE] 'conda' not found." @@ -50,7 +56,7 @@ cd "${OUTPUT_DIR}/${ENV_NAME}" if [[ "${input_params}" == *"use_conda=yes"* ]]; then set +x eval "$(conda shell.bash hook)" - $CONDA_PATH env create --file conda/dev.yaml --name "${ENV_NAME}" --yes + $MAMBA_PATH env create --file conda/dev.yaml --name "${ENV_NAME}" --yes $CONDA_PATH activate "${ENV_NAME}" set -x fi