Skip to content

Commit f09aa82

Browse files
authored
Merge pull request #99 from Miyamura80/feature/consolidate-init-makefile
Consolidate initialization logic into root Makefile
2 parents 9497900 + c037ec7 commit f09aa82

4 files changed

Lines changed: 17 additions & 25 deletions

File tree

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Super-opinionated Python stack for fast development. Python >= 3.12 required. Us
1010

1111
```bash
1212
# Setup & Run
13+
make init name=... description=... # Initialize project name and description
1314
make setup # Create/update .venv and sync dependencies
1415
make all # Run main.py with setup
1516

Makefile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,24 @@ help: ## Show this help message
3232
}' $(MAKEFILE_LIST)
3333

3434
########################################################
35-
# Initialization: Delete later
35+
# Initialization
3636
########################################################
3737

3838
### Initialization
39+
.PHONY: init banner logo
40+
init: ## Initialize project (usage: make init name=my-project description="my description")
41+
@if [ -z "$(name)" ] || [ -z "$(description)" ]; then \
42+
echo "$(RED)Error: Both 'name' and 'description' parameters are required$(RESET)"; \
43+
echo "Usage: make init name=<project_name> description=<project_description>"; \
44+
exit 1; \
45+
fi
46+
@echo "$(YELLOW)🚀 Initializing project $(name)...$(RESET)"
47+
@sed -i.bak "s/name = \"python-template\"/name = \"$(name)\"/" pyproject.toml && rm pyproject.toml.bak
48+
@sed -i.bak "s/description = \"Add your description here\"/description = \"$(description)\"/" pyproject.toml && rm pyproject.toml.bak
49+
@sed -i.bak "s/# Python-Template/# $(name)/" README.md && rm README.md.bak
50+
@sed -i.bak "s/<b>Opinionated Python project stack. 🔋 Batteries included. <\/b>/<b>$(description)<\/b>/" README.md && rm README.md.bak
51+
@echo "$(GREEN)✅ Updated project name and description.$(RESET)"
52+
3953
banner: check_uv ## Generate project banner image
4054
@echo "$(YELLOW)🔍Generating banner...$(RESET)"
4155
@uv run python -m init.generate_banner

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Opinionated Python stack for fast development. The `saas` branch extends `main`
5555

5656
## Quick Start
5757

58+
- `make init name=my-project description="My project description"` - initialize project
5859
- `make all` - runs `main.py`
5960
- `make fmt` - runs `ruff format` + JSON formatting
6061
- `make banner` - create a new banner that makes the README nice 😊

init/Makefile

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)