Skip to content

Commit 53cbdd0

Browse files
committed
Fail early in 'venv install' if 'venv clear' fails
1 parent c627952 commit 53cbdd0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/venv-cli/venv.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,9 @@ venv::install() {
266266

267267
# Clear the environment before running pip install to avoid orphaned packages
268268
# https://github.com/SallingGroup-AI-and-ML/venv-cli/issues/9
269-
venv::clear
269+
if ! venv::clear; then
270+
return "${_fail}"
271+
fi
270272

271273
venv::color_echo "${_green}" "Installing requirements from ${requirements_file}"
272274
if ! pip install --require-virtualenv --use-pep517 -r "${requirements_file}" "$@"; then

0 commit comments

Comments
 (0)