From c71469bccd48757ed062519e64809c4b8c6d5d74 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 10 Sep 2025 10:39:51 +0200 Subject: Makefile: add maintenance target --- Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 7f30332..b68c4f6 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,25 @@ venv/upgrade: venv/reset && pip uninstall -q --yes '$(call escape,$(PROJECT))' \ && pip freeze > requirements.txt +.PHONY: maintenance +maintenance: + $(MAKE) venv/upgrade + + @git_status="$$( git status --porcelain=v1 )" && \ + if [ -z "$$git_status" ]; then \ + true; \ + elif [ "$$git_status" = ' M requirements.txt' ]; then \ + git commit -am 'requirements.txt: bump dependencies' && \ + git push -q; \ + else \ + echo; \ + echo '-----------------------------------------------------------------'; \ + echo 'Error: unrecognized modifications in the repository:'; \ + echo "$$git_status"; \ + echo '-----------------------------------------------------------------'; \ + exit 1; \ + fi + .PHONY: python python: $(venv_activate) && python -- cgit v1.2.3