Skip to content

Commit 8161189

Browse files
committed
fix: Verify Git repository presence
1 parent 514bf59 commit 8161189

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

Makefile.jinja

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,28 @@ CLEAN_FILES := *.pyc
77
help: ## Display available commands
88
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
99

10-
check: ## Verify required tools are available
10+
check: ## Verify required tools and Git repository
1111
@set -eu; \
12+
if ! git rev-parse --git-dir >/dev/null 2>&1; then \
13+
printf "ERROR: Not a Git repository — run 'git init' first\n" >&2; \
14+
exit 1; \
15+
fi
1216
for cmd in uv pre-commit; do \
1317
if ! command -v "$$cmd" >/dev/null 2>&1; then \
1418
printf "ERROR: %s missing — install it\n" "$$cmd" >&2; \
1519
exit 1; \
1620
fi; \
17-
done
21+
done; \
1822

1923
install: check ## Install project dependencies
20-
@pre-commit install
21-
@uv sync --extra dev
24+
@printf "Installing pre-commit hooks...\n"
25+
@pre-commit install || { printf "ERROR: pre-commit installation failed\n" >&2; exit 1; }
26+
@printf "Installing project dependencies...\n"
27+
@uv sync --extra dev || { printf "ERROR: uv sync failed\n" >&2; exit 1; }
28+
@printf "\u2713 Installation complete\n"
2229

2330
{% if "pytest" in dev_deps -%}
24-
test: ## Run all unit tests
31+
test: check ## Run all unit tests
2532
@set -eu; \
2633
if [[ ! -d ".venv" ]]; then \
2734
printf "ERROR: .venv not found — run 'make install' first\n" >&2; \

0 commit comments

Comments
 (0)