aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Makefile
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2025-09-10 10:39:51 +0200
committerEgor Tensin <egor@tensin.name>2025-09-10 10:39:51 +0200
commitc71469bccd48757ed062519e64809c4b8c6d5d74 (patch)
treec7bc7cba6643dd17562c93da7eccfd68e3b6a69c /Makefile
parentstop docker-compose from annoying me (diff)
downloadcgitize-c71469bccd48757ed062519e64809c4b8c6d5d74.tar.gz
cgitize-c71469bccd48757ed062519e64809c4b8c6d5d74.zip
Makefile: add maintenance target
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 19 insertions, 0 deletions
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