From d597193f00de7003f7b6dc347736d77e8f96b9dc Mon Sep 17 00:00:00 2001 From: Xiang Dai <764524258@qq.com> Date: Wed, 29 Jan 2020 19:28:20 +0800 Subject: [PATCH] Makefile: optiomize jsonnet-format target Signed-off-by: Xiang Dai <764524258@qq.com> --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index cbdf5ef39a..dd3641dfa8 100644 --- a/Makefile +++ b/Makefile @@ -359,6 +359,9 @@ JSONNET_FMT := jsonnetfmt -n 2 --max-blank-lines 2 --string-style s --comment-st .PHONY: jsonnet-format jsonnet-format: + @which jsonnetfmt 2>/dev/null || ( \ + echo "Cannot find jsonnetfmt command, please install from https://github.com/google/jsonnet/releases. If your C++ does not support GLIBCXX_3.4.20, please use xxx-in-container target like jsonnet-format-in-container." && exit 1 + ) find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \ xargs -n 1 -- $(JSONNET_FMT) -i