Skip to content

Commit

Permalink
Explicit if-else
Browse files Browse the repository at this point in the history
  • Loading branch information
HyukjinKwon committed Jul 16, 2020
1 parent 26ad703 commit fcb833c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions dev/run-pip-tests
Expand Up @@ -81,7 +81,11 @@ for python in "${PYTHON_EXECS[@]}"; do
source "$CONDA_PREFIX/etc/profile.d/conda.sh"
fi
conda create -y -p "$VIRTUALENV_PATH" python=$python numpy pandas pip setuptools
source activate "$VIRTUALENV_PATH" || conda activate "$VIRTUALENV_PATH"
if [ -z "$JAVA_HOME" ]; then
source activate "$VIRTUALENV_PATH"
else
conda activate "$VIRTUALENV_PATH"
fi
else
mkdir -p "$VIRTUALENV_PATH"
virtualenv --python=$python "$VIRTUALENV_PATH"
Expand Down Expand Up @@ -125,7 +129,11 @@ for python in "${PYTHON_EXECS[@]}"; do

# conda / virtualenv environments need to be deactivated differently
if [ -n "$USE_CONDA" ]; then
source deactivate || conda deactivate
if [ -z "$JAVA_HOME" ]; then
source deactivate
else
conda deactivate
fi
else
deactivate
fi
Expand Down

0 comments on commit fcb833c

Please sign in to comment.