aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Makefile
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2024-07-01 13:51:08 +0200
committerEgor Tensin <egor@tensin.name>2024-07-01 13:51:08 +0200
commit786aa60e63bab4e546d5b90d3e44a307176ec92d (patch)
treeb47a19cf0ab05f4d684745c84df268175dc60cf2 /Makefile
parentbump dependencies (diff)
downloadjekyll-theme-786aa60e63bab4e546d5b90d3e44a307176ec92d.tar.gz
jekyll-theme-786aa60e63bab4e546d5b90d3e44a307176ec92d.zip
Makefile: add maintenance alias
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 19 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index b2862d4..6321ed7 100644
--- a/Makefile
+++ b/Makefile
@@ -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