Skip to content

Commit

Permalink
Makefile: Prefer Ruby 2.7 if available
Browse files Browse the repository at this point in the history
Ruby 3.0, which is now default in Debian (and likely many other
distros), isn't officially supported by the github/pages-gem and some of
its dependencies (despite patches being available for over a year—WTF),
so `make serve` doesn't work.

As a workaround, prefer Ruby 2.7 (the "bundle2.7" command) if available.

Related: xmonad#37
  • Loading branch information
liskin committed Mar 11, 2022
1 parent 1e4147a commit 24c84b5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
BUNDLE := $(if $(shell command -v bundle2.7),bundle2.7,bundle)
export BUNDLE_PATH ?= $(CURDIR)/.bundle/gems

.PHONY: build
build: .bundle/.done
bundle exec jekyll build --drafts
$(BUNDLE) exec jekyll build --drafts

.PHONY: serve
serve: .bundle/.done
bundle exec jekyll serve --drafts --livereload
$(BUNDLE) exec jekyll serve --drafts --livereload

.bundle/.done: Gemfile
bundle install
$(BUNDLE) install
touch $@

.PHONY: clean
Expand Down

0 comments on commit 24c84b5

Please sign in to comment.