diff options
author | Egor Tensin <egor@tensin.name> | 2024-07-01 13:54:15 +0200 |
---|---|---|
committer | Egor Tensin <egor@tensin.name> | 2024-07-01 13:54:15 +0200 |
commit | 8622b9fbaae45ea72148d89dfebb182e67dcb59b (patch) | |
tree | d7079f954b7d6ce96900c973506c3f102c8eb38e | |
parent | bump dependencies (diff) | |
download | sorting-algorithms-8622b9fbaae45ea72148d89dfebb182e67dcb59b.tar.gz sorting-algorithms-8622b9fbaae45ea72148d89dfebb182e67dcb59b.zip |
Makefile: add maintenance alias
-rw-r--r-- | DEVELOPMENT.md | 8 | ||||
-rw-r--r-- | Makefile | 19 |
2 files changed, 26 insertions, 1 deletions
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 8d87c68..9cea926 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -31,7 +31,13 @@ Development Upgrading dependencies ---------------------- - bundle update +* To upgrade dependencies in Gemfile.lock & push them to the repository: + + make maintenance + +* Manually upgrade dependencies in Gemfile.lock: + + bundle update Building static pages --------------------- @@ -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 |