| 1 |
# Based on conventions from https://github.com/github/scripts-to-rule-them-all |
| 2 |
# script/bootstrap: Resolve all dependencies that the application requires to |
| 3 |
# run. |
| 4 |
|
| 5 |
if ! command -v uv &> /dev/null; then |
| 6 |
echo "uv could not be found. Do you want to install it? (y/n)" |
| 7 |
read -r |
| 8 |
if [[ "$REPLY" =~ ^[Yy]$ ]]; then |
| 9 |
if command -v brew &> /dev/null; then |
| 10 |
brew install uv |
| 11 |
else |
| 12 |
curl -fsSL https://astral.sh/uv/install.sh | sh |
| 13 |
fi |
| 14 |
else |
| 15 |
echo "Please install uv to continue" |
| 16 |
return |
| 17 |
fi |
| 18 |
fi |
| 19 |
|
| 20 |
uv venv --allow-existing |
| 21 |
source .venv/bin/activate |
| 22 |
|
| 23 |
uv run -m python_githooks |
| 24 |
|
| 25 |
if ! complete -p invoke &>/dev/null; then |
| 26 |
source <(inv --print-completion-script bash) |
| 27 |
fi |