diff options
author | Egor Tensin <egor@tensin.name> | 2025-09-10 10:39:51 +0200 |
---|---|---|
committer | Egor Tensin <egor@tensin.name> | 2025-09-10 10:39:51 +0200 |
commit | c71469bccd48757ed062519e64809c4b8c6d5d74 (patch) | |
tree | c7bc7cba6643dd17562c93da7eccfd68e3b6a69c /Makefile | |
parent | stop docker-compose from annoying me (diff) | |
download | cgitize-c71469bccd48757ed062519e64809c4b8c6d5d74.tar.gz cgitize-c71469bccd48757ed062519e64809c4b8c6d5d74.zip |
Makefile: add maintenance target
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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 |