diff options
author | Egor Tensin <egor@tensin.name> | 2024-07-01 13:49:19 +0200 |
---|---|---|
committer | Egor Tensin <egor@tensin.name> | 2024-07-01 13:49:19 +0200 |
commit | bfd1601a5a381b901e2b96b2419fc3bd5c260305 (patch) | |
tree | bafb5baa17843be0ac3377bc00a4881089fda0ac /Makefile | |
parent | bump dependencies (diff) | |
download | blog-bfd1601a5a381b901e2b96b2419fc3bd5c260305.tar.gz blog-bfd1601a5a381b901e2b96b2419fc3bd5c260305.zip |
Makefile: add maintenance alias
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -14,6 +14,25 @@ ruby: deps: ruby bundle install +.PHONY: maintenance +maintenance: ruby + bundle update + @git_status="$$( git status --porcelain=v1 )" && \ + file_statuses="$$( echo "$$git_status" | cut -c 1-2 | sort -u )" && \ + file_names="$$( echo "$$git_status" | cut -c 4- | grep -o '[^/]*$$' | sort -u )" && \ + if [ -z "$$git_status" ]; then \ + true ; \ + elif [ "$$file_statuses $$file_names" = ' M Gemfile.lock' ]; then \ + git commit -am 'bump dependencies' && \ + git push -q ; \ + else \ + echo ; \ + echo '-----------------------------------------------------------------'; \ + echo 'Error: unrecognized modifications in the repository'; \ + echo '-----------------------------------------------------------------'; \ + exit 1; \ + fi + jekyll := bundle exec jekyll .PHONY: build |