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:
Janik von Rotz committed 2026-10-06 10:02:38 +02:00
1 parent 2dc146b2f4
commit c21197a1ec
2 files changed
+4 -3

No files matched your search

+3 -2
View File
@@ -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
+1 -1
View File
@@ -139,7 +139,7 @@ run-container() {
docker pull "$image_tag"
docker rm -f "$container_name"
docker volume rm "$container_name"
# docker volume rm "$container_name"
docker run -p 8080:80 -d \
--name "$container_name" \