Skip to content

Commit 9ffb80d

Browse files
committed
simple check for conda directories
1 parent 6d49004 commit 9ffb80d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scripts/build-setup.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,15 @@ if run_step "1"; then
156156
# note: lock file must end in .conda-lock.yml - see https://github.com/conda-incubator/conda-lock/issues/154
157157
CONDA_REQS=$CYDIR/conda-reqs
158158
CONDA_LOCK_REQS=$CONDA_REQS/conda-lock-reqs
159+
160+
# check if directories already exist
161+
if [ -d "$CONDA_REQS" ] || [ -d "$CONDA_LOCK_REQS"]; then
162+
echo "Error: Directories $CONDA_REQS and/or "$CONDA_LOCK_REQS" already exist! \
163+
Delete them before trying to recreate the conda environment or \`source env.sh\` \
164+
and skip this step with \`-s 1\`." >&2
165+
exit 1
166+
fi
167+
159168
# must match with the file generated by generate-conda-lockfile.sh
160169
if [ "$USE_LEAN_CONDA" = false ]; then
161170
LOCKFILE=$CONDA_LOCK_REQS/conda-requirements-$TOOLCHAIN_TYPE-linux-64.conda-lock.yml

0 commit comments

Comments
 (0)