Skip to content

Commit

Permalink
fix bash if condition
Browse files Browse the repository at this point in the history
  • Loading branch information
xmnlab committed Jun 20, 2024
1 parent 0e9fdfd commit a7d8298
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/smoke/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a7d8298

Please sign in to comment.