Skip to content

Commit

Permalink
Merge pull request #3 from cytopia/release-0.3
Browse files Browse the repository at this point in the history
Release 0.3
  • Loading branch information
cytopia authored Jul 6, 2019
2 parents 60e7f45 + e61c38d commit 4a3861f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
21 changes: 20 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ifneq (,)
.error This Makefile requires GNU Make.
endif

.PHONY: build rebuild lint test _test-tf-version _test-fmt-ok _test-fmt-fail tag pull login push enter
.PHONY: build rebuild lint test _test-tf-version _test-fmt-ok _test-fmt-none _test-fmt-fail tag pull login push enter

CURRENT_DIR = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

Expand All @@ -28,6 +28,7 @@ lint:
test:
@$(MAKE) --no-print-directory _test-tf-version
@$(MAKE) --no-print-directory _test-fmt-ok
@$(MAKE) --no-print-directory _test-fmt-none
@$(MAKE) --no-print-directory _test-fmt-fail

_test-tf-version:
Expand Down Expand Up @@ -84,6 +85,24 @@ _test-fmt-ok:
fi; \
echo "Success";

_test-fmt-none:
@echo "------------------------------------------------------------"
@echo "- Testing terragrunt-fmt (NONE) [recursive]"
@echo "------------------------------------------------------------"
@if ! docker run --rm -v $(CURRENT_DIR)/data:/data $(IMAGE) -write=false -list=true -check -diff -recursive; then \
echo "Failed"; \
exit 1; \
fi; \
echo "Success";
@echo "------------------------------------------------------------"
@echo "- Testing terragrunt-fmt (NONE) [dir]"
@echo "------------------------------------------------------------"
@if ! docker run --rm -v $(CURRENT_DIR)/data:/data $(IMAGE) -write=false -list=true -check -diff; then \
echo "Failed"; \
exit 1; \
fi; \
echo "Success";

_test-fmt-fail:
@echo "------------------------------------------------------------"
@echo "- Testing terragrunt-fmt (FAIL) [recursive]"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ fix: _pull
-write -diff -recursive -ignore='$(IGNORE)'

_pull:
docker pull cytopia/terraform-fmt:$(FMT_VERSION)
docker pull cytopia/terragrunt-fmt:$(FMT_VERSION)
```

#### Travis CI integration
Expand Down
6 changes: 4 additions & 2 deletions data/terragrunt-fmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,10 @@ else
echo "[INFO] Finding files: for file in *.hcl; do"
ret=0
for file in *.hcl; do
if ! /fmt.sh "${ARG_LIST}" "${ARG_WRITE}" "${ARG_DIFF}" "${ARG_CHECK}" "${file}"; then
ret="1"
if [ -f "${file}" ]; then
if ! /fmt.sh "${ARG_LIST}" "${ARG_WRITE}" "${ARG_DIFF}" "${ARG_CHECK}" "${file}"; then
ret="1"
fi
fi
done
exit "${ret}"
Expand Down

0 comments on commit 4a3861f

Please sign in to comment.