diff --git a/scripts/bootstrap b/scripts/bootstrap index 3581b0a..ae2f403 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -10,16 +10,18 @@ echo "==> Updating system packages..." sudo apt-get update sudo apt-get upgrade -y -rm -rf .venv/ - echo "==> Checking for uv..." if ! command -v uv >/dev/null 2>&1; then echo "UV not found, installing..." pipx install uv fi -echo "==> Setting up Python environment..." -uv venv && . .venv/bin/activate +# if no venv, create one +if [ ! -d "$HOME/.venv" ]; then + echo "==> Creating virtual environment..." + uv venv "$HOME/.venv" +fi +. "$HOME/.venv/bin/activate" echo "==> Installing dependencies..." uv pip install --requirement requirements.txt @@ -27,4 +29,14 @@ uv pip install --requirement requirements.txt echo "==> Installing pre-commit hooks..." pre-commit install +echo "==> Updating shell environment..." +if ! grep -q "source $HOME/.venv/bin/activate" ~/.bashrc; then + echo "source $HOME/.venv/bin/activate" >> ~/.bashrc +fi +if [ -f ~/.zshrc ]; then + if ! grep -q "source $HOME/.venv/bin/activate" ~/.zshrc; then + echo "source $HOME/.venv/bin/activate" >> ~/.zshrc + fi +fi + echo "==> Bootstrap completed!" diff --git a/scripts/develop b/scripts/develop index 5124b11..a9bf096 100755 --- a/scripts/develop +++ b/scripts/develop @@ -7,7 +7,7 @@ set -e cd "$(dirname "$0")/.." if [ -z "$VIRTUAL_ENV" ]; then - . .venv/bin/activate + . "$HOME/.venv/bin/activate" fi # Create config dir if not present