From c42caeb5b660a7c87a8951975c89246faf821c2d Mon Sep 17 00:00:00 2001 From: Timo Beckers Date: Thu, 19 Oct 2023 10:08:30 +0200 Subject: [PATCH] docs: improve Makefile UX with pipenv sync Include 'pipenv sync' in the 'pipenv' make target to get the behaviour documented in the README. Also adds an `exec` to the 'shell' target to avoid an error from make when the shell exits. Also, no need to keep make running during a shell session. Signed-off-by: Timo Beckers --- docs/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/Makefile b/docs/Makefile index 9aede7afe..2c7176f45 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -12,11 +12,17 @@ preview: pipenv pipenv run mkdocs serve shell: pipenv - pipenv shell + @echo "pipenv shell" + @exec pipenv shell pipenv: ifeq (, $(shell command -v pipenv 2> /dev/null)) $(error "pipenv is not installed, exiting..") endif + @# Ensure a venv and install dependencies from Pipfile.lock. Buffer stdio + @# and display it on error as pipenv uses stdin and stderr arbitrarily. + @echo "pipenv sync" + @out=`pipenv sync 2>&1` || echo "$${out}" + .PHONY: pipenv