Skip to content

Commit

Permalink
Fixes #149, tf/lint on mac xargs does not support --no-run-if-empty (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Gowiem authored May 7, 2020
1 parent b0a1882 commit 00e2d7e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/terraform/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 00e2d7e

Please sign in to comment.