File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -187,9 +187,17 @@ define user_confirm
187187 fi
188188endef
189189
190+ # https://stackoverflow.com/questions/4251559/how-can-i-tell-if-a-makefile-is-being-run-from-an-interactive-shell
191+ INTERACTIVE: =$(shell [ -t 0 ] && echo 1)
192+ ifdef INTERACTIVE
193+ DOCKER_OPTIONS="-it"
194+ else
195+ DOCKER_OPTIONS=""
196+ endif
197+
190198# $(call DOCKER, image, command)
191199define DOCKER
192- docker run -it --rm -e GOCACHE=/app/.cache -e IN_DOCKER=1 -w /app -v $(PWD ) :/app -v $(GOPATH ) :/go --init $(1 ) /bin/bash -c '$(2 ) '
200+ docker run " $( DOCKER_OPTIONS ) " --rm -e GOCACHE=/app/.cache -e IN_DOCKER=1 -w /app -v $(PWD ) :/app -v $(GOPATH ) :/go --init $(1 ) /bin/bash -c '$(2 ) '
193201endef
194202
195203ifeq ($(BUILD_IN_DOCKER ) ,y)
213221 PATHSEP = :
214222endif
215223
224+
216225v_at_0 = yes
217226v_at_ = $(v_at_1 )
218227quiet := $(v_at_$(V ) )
You can’t perform that action at this time.
0 commit comments