Skip to content

Commit dd4250e

Browse files
committed
refactor: update create-admin make target to support promoting existing users without a password
1 parent f30809f commit dd4250e

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,16 @@ setup: install-hooks
151151
@echo "Setup complete."
152152

153153
# Create or promote admin user
154-
# Usage: make create-admin EMAIL=admin@example.com PASSWORD=securepass
155-
# Optional: make create-admin EMAIL=admin@example.com PASSWORD=securepass NAME="Admin"
154+
# Promote existing user: make create-admin EMAIL=user@example.com
155+
# Create new admin: make create-admin EMAIL=admin@example.com PASSWORD=securepass NAME="Admin"
156156
create-admin:
157-
@if [ -z "$(EMAIL)" ] || [ -z "$(PASSWORD)" ]; then \
158-
echo "Error: EMAIL and PASSWORD are required. Usage: make create-admin EMAIL=admin@example.com PASSWORD=securepass"; \
157+
@if [ -z "$(EMAIL)" ]; then \
158+
echo "Error: EMAIL is required."; \
159+
echo " Promote existing user: make create-admin EMAIL=user@example.com"; \
160+
echo " Create new admin: make create-admin EMAIL=admin@example.com PASSWORD=securepass"; \
159161
exit 1; \
160162
fi
161-
docker-compose exec backend uv run python -m scripts.create_admin --email $(EMAIL) --password $(PASSWORD) $(if $(NAME),--name "$(NAME)")
163+
docker-compose exec backend uv run python -m scripts.create_admin --email $(EMAIL) $(if $(PASSWORD),--password $(PASSWORD)) $(if $(NAME),--name "$(NAME)")
162164

163165
# Show running containers
164166
ps:

0 commit comments

Comments
 (0)