From a9ac9f6cba77fd12154bccc8e8647b6dd1a8fba0 Mon Sep 17 00:00:00 2001 From: Viktorius Suwandi Date: Thu, 27 Jul 2023 17:00:38 +0700 Subject: [PATCH] fix: update DOCKER CMD on docs/Makefile (#1745) Co-authored-by: Moritz Wiesinger --- docs/Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/Makefile b/docs/Makefile index 797f53542b..72386cd203 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -4,7 +4,16 @@ VOLUMES := -v $(ROOT_DIR):/src HUGO_VERSION := 0.111.3 IMAGE := klakegg/hugo:$(HUGO_VERSION)-ext PORT := 1314 -DOCKER_CMD := docker run --rm -t -e HUGO_CACHEDIR=/src/tmp/.hugo -e HUGOxPARAMSxGITHUB_REPO="" + +INTERACTIVE:=$(shell [ -t 0 ] && echo 1) + +ifdef INTERACTIVE +# is a terminal +INTERACTIVE_FLAG := -it +else +INTERACTIVE_FLAG := -t +endif +DOCKER_CMD := docker run --rm $(INTERACTIVE_FLAG) -e HUGO_CACHEDIR=/src/tmp/.hugo -e HUGOxPARAMSxGITHUB_REPO="" .PHONY: build server clean shell