From 00e2d7ef44742e297c7779431e5d43bb3599bb76 Mon Sep 17 00:00:00 2001 From: Matt Gowie Date: Thu, 7 May 2020 14:08:32 -0600 Subject: [PATCH] Fixes #149, tf/lint on mac xargs does not support --no-run-if-empty (#206) --- modules/terraform/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/terraform/Makefile b/modules/terraform/Makefile index a159f3e7..83eaa379 100644 --- a/modules/terraform/Makefile +++ b/modules/terraform/Makefile @@ -32,8 +32,13 @@ endif ## Lint check Terraform terraform/lint: +ifeq ($(OS), darwin) + @FAIL=`$(TERRAFORM) fmt -write=false | xargs -n 1 printf '\t- %s\n'`; \ + [ -z "$$FAIL" ] || (echo "Terraform configuration needs linting. Run '$(TERRAFORM) fmt'"; echo $$FAIL; exit 1) +else @FAIL=`$(TERRAFORM) fmt -write=false | xargs --no-run-if-empty -n 1 printf '\t- %s\n'`; \ [ -z "$$FAIL" ] || (echo "Terraform configuration needs linting. Run '$(TERRAFORM) fmt'"; echo $$FAIL; exit 1) +endif ## Upgrade all terraform module sources terraform/upgrade-modules: packages/install/json2hcl