feat: improve venv activation logic and disable container volume cleanup
- Update `activate-venv` to verify Python executable existence before activation - Automatically remove and reinitialize invalid virtual environments - Comment out `docker volume rm` in `run-container` to prevent accidental data loss
This commit is contained in:
2 files changed
+4
-3
No files matched your search
+3
-2
@@ -2,11 +2,12 @@
|
||||
|
||||
activate-venv() {
|
||||
uv_venv="${VENV_PATH:-.venv}"
|
||||
if [[ -f "$uv_venv/bin/activate" ]]; then
|
||||
if [[ -f "$uv_venv/bin/activate" && -e "$uv_venv/bin/python" ]]; then
|
||||
source "$uv_venv/bin/activate"
|
||||
else
|
||||
echo "Could not find $uv_venv/bin/activate"
|
||||
echo "Could not find valid $uv_venv"
|
||||
echo "Init venv with $(uv --version)"
|
||||
rm -rf "$uv_venv"
|
||||
uv venv "$uv_venv"
|
||||
source "$uv_venv/bin/activate"
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user