Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
golang.mk: Check and install yq before use it
Browse files Browse the repository at this point in the history
golang.mk call yq to get golang_version_min but some environments do
not install it.
This patch check and install yq before use it to handle the issue.

Fixes #899

Signed-off-by: Hui Zhu <teawater@hyper.sh>
  • Loading branch information
teawater committed Nov 10, 2018
1 parent ebd86d6 commit f5048b7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion golang.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
# Check that the system golang version is within the required version range
# for this project.

golang_version_min=$(shell yq r versions.yaml languages.golang.version)
have_yq=$(shell if [ -x "$(GOPATH)/bin/yq" ]; then echo "true"; else echo ""; fi)
ifeq (,$(have_yq))
install_yq=$(shell .ci/install-yq.sh)
endif
ifneq (,$(install_yq))
$(error "ERROR: install yq failed")
endif
golang_version_min=$(shell $(GOPATH)/bin/yq r versions.yaml languages.golang.version)

ifeq (,$(golang_version_min))
$(error "ERROR: cannot determine minimum golang version")
Expand Down

0 comments on commit f5048b7

Please sign in to comment.