Skip to content

Commit 4a3861f

Browse files
authored
Merge pull request #3 from cytopia/release-0.3
Release 0.3
2 parents 60e7f45 + e61c38d commit 4a3861f

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

Makefile

+20-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ifneq (,)
22
.error This Makefile requires GNU Make.
33
endif
44

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

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

@@ -28,6 +28,7 @@ lint:
2828
test:
2929
@$(MAKE) --no-print-directory _test-tf-version
3030
@$(MAKE) --no-print-directory _test-fmt-ok
31+
@$(MAKE) --no-print-directory _test-fmt-none
3132
@$(MAKE) --no-print-directory _test-fmt-fail
3233

3334
_test-tf-version:
@@ -84,6 +85,24 @@ _test-fmt-ok:
8485
fi; \
8586
echo "Success";
8687

88+
_test-fmt-none:
89+
@echo "------------------------------------------------------------"
90+
@echo "- Testing terragrunt-fmt (NONE) [recursive]"
91+
@echo "------------------------------------------------------------"
92+
@if ! docker run --rm -v $(CURRENT_DIR)/data:/data $(IMAGE) -write=false -list=true -check -diff -recursive; then \
93+
echo "Failed"; \
94+
exit 1; \
95+
fi; \
96+
echo "Success";
97+
@echo "------------------------------------------------------------"
98+
@echo "- Testing terragrunt-fmt (NONE) [dir]"
99+
@echo "------------------------------------------------------------"
100+
@if ! docker run --rm -v $(CURRENT_DIR)/data:/data $(IMAGE) -write=false -list=true -check -diff; then \
101+
echo "Failed"; \
102+
exit 1; \
103+
fi; \
104+
echo "Success";
105+
87106
_test-fmt-fail:
88107
@echo "------------------------------------------------------------"
89108
@echo "- Testing terragrunt-fmt (FAIL) [recursive]"

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ fix: _pull
181181
-write -diff -recursive -ignore='$(IGNORE)'
182182

183183
_pull:
184-
docker pull cytopia/terraform-fmt:$(FMT_VERSION)
184+
docker pull cytopia/terragrunt-fmt:$(FMT_VERSION)
185185
```
186186

187187
#### Travis CI integration

data/terragrunt-fmt.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,10 @@ else
283283
echo "[INFO] Finding files: for file in *.hcl; do"
284284
ret=0
285285
for file in *.hcl; do
286-
if ! /fmt.sh "${ARG_LIST}" "${ARG_WRITE}" "${ARG_DIFF}" "${ARG_CHECK}" "${file}"; then
287-
ret="1"
286+
if [ -f "${file}" ]; then
287+
if ! /fmt.sh "${ARG_LIST}" "${ARG_WRITE}" "${ARG_DIFF}" "${ARG_CHECK}" "${file}"; then
288+
ret="1"
289+
fi
288290
fi
289291
done
290292
exit "${ret}"

0 commit comments

Comments
 (0)