Skip to content

Commit

Permalink
Makefile: install josonnet before do jsonnet format
Browse files Browse the repository at this point in the history
Signed-off-by: Xiang Dai <[email protected]>
  • Loading branch information
daixiang0 committed Jan 29, 2020
1 parent d588418 commit 97f54a8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ GOJSONTOYAML ?= $(GOBIN)/gojsontoyaml-$(GOJSONTOYAML_VERSION)
# v0.14.0
JSONNET_VERSION ?= fbde25be2182caa4345b03f1532450911ac7d1f3
JSONNET ?= $(GOBIN)/jsonnet-$(JSONNET_VERSION)
JSONNETFMT ?= $(GOBIN)/jsonnetfmt-$(JSONNET_VERSION)
JSONNET_BUNDLER_VERSION ?= d7829f6c7e632e954c0e5db8b3eece8f111f9461
JSONNET_BUNDLER ?= $(GOBIN)/jb-$(JSONNET_BUNDLER_VERSION)
# Prometheus v2.14.0
Expand Down Expand Up @@ -358,7 +359,7 @@ jsonnet-vendor: $(JSONNET_BUNDLER) jsonnetfile.json jsonnetfile.lock.json
JSONNET_FMT := jsonnetfmt -n 2 --max-blank-lines 2 --string-style s --comment-style s

.PHONY: jsonnet-format
jsonnet-format: $(JSONNET)
jsonnet-format: $(JSONNETFMT)
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
xargs -n 1 -- $(JSONNET_FMT) -i

Expand Down Expand Up @@ -425,6 +426,9 @@ $(PROTOC):
$(JSONNET):
$(call fetch_go_bin_version,github.com/google/go-jsonnet/cmd/jsonnet,$(JSONNET_VERSION))

$(JSONNET):
$(call fetch_go_bin_version,github.com/google/go-jsonnet/cmd/jsonnetfmt,$(JSONNET_VERSION))

$(GOJSONTOYAML):
$(call fetch_go_bin_version,github.com/brancz/gojsontoyaml,$(GOJSONTOYAML_VERSION))

Expand Down

0 comments on commit 97f54a8

Please sign in to comment.