hass.tibber_prices/scripts/bootstrap
2025-11-03 17:00:08 +00:00

30 lines
610 B
Bash
Executable file

#!/bin/sh
# script/bootstrap: Install/update all dependencies required to run the project
set -e
cd "$(dirname "$0")/.."
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
echo "==> Installing dependencies..."
uv pip install --requirement requirements.txt
echo "==> Installing pre-commit hooks..."
pre-commit install
echo "==> Bootstrap completed!"