mirror of
https://github.com/jpawlowski/hass.tibber_prices.git
synced 2026-03-29 21:03:40 +00:00
fix bootstrap
This commit is contained in:
parent
c6eed9329b
commit
6d4669c8e7
2 changed files with 17 additions and 5 deletions
|
|
@ -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!"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue