Skip to content

Commit a3e9c62

Browse files
committed
Fix examples
1 parent fbab80b commit a3e9c62

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ You are able to use different delimiter. Let's imagine the following delimiter:
108108
# Note that the command changes from terraform-docs to terraform-docs-replace
109109
docker run --rm \
110110
-v $(pwd):/docs \
111-
-e DELIM_START=TFDOC_START \
112-
-e DELIM_CLOSE=TFDOC_END \
111+
-e DELIM_START='TFDOC_START' \
112+
-e DELIM_CLOSE='TFDOC_END' \
113113
cytopia/terraform-docs \
114114
terraform-docs-replace --sort-inputs-by-required --with-aggregate-type-defaults md INFO.md
115115
```
@@ -126,6 +126,10 @@ TF_EXAMPLES = $(sort $(dir $(wildcard $(CURRENT_DIR)examples/*/)))
126126
TF_MODULES = $(sort $(dir $(wildcard $(CURRENT_DIR)modules/*/)))
127127
TF_DOCS_VERSION = 0.6.0
128128

129+
# Adjust your delimiter here or overwrite via make arguments
130+
DELIM_START = <!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
131+
DELIM_CLOSE = <!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
132+
129133
gen:
130134
@echo "################################################################################"
131135
@echo "# Terraform-docs generate"
@@ -138,7 +142,10 @@ _gen-main:
138142
@echo "------------------------------------------------------------"
139143
@echo "# Main module"
140144
@echo "------------------------------------------------------------"
141-
@if docker run --rm -v $(CURRENT_DIR):/docs \
145+
@if docker run --rm \
146+
-v $(CURRENT_DIR):/docs \
147+
-e DELIM_START='$(DELIM_START)' \
148+
-e DELIM_CLOSE='$(DELIM_CLOSE)' \
142149
cytopia/terraform-docs:${TF_DOCS_VERSION} \
143150
terraform-docs-replace --sort-inputs-by-required --with-aggregate-type-defaults md README.md; then \
144151
echo "OK"; \
@@ -154,7 +161,10 @@ _gen-examples:
154161
echo "------------------------------------------------------------"; \
155162
echo "# $${DOCKER_PATH}"; \
156163
echo "------------------------------------------------------------"; \
157-
if docker run --rm -v $(CURRENT_DIR):/docs \
164+
if docker run --rm \
165+
-v $(CURRENT_DIR):/docs \
166+
-e DELIM_START='$(DELIM_START)' \
167+
-e DELIM_CLOSE='$(DELIM_CLOSE)' \
158168
cytopia/terraform-docs:${TF_DOCS_VERSION} \
159169
terraform-docs-replace --sort-inputs-by-required --with-aggregate-type-defaults md $${DOCKER_PATH}/README.md; then \
160170
echo "OK"; \
@@ -171,7 +181,10 @@ _gen-modules:
171181
echo "------------------------------------------------------------"; \
172182
echo "# $${DOCKER_PATH}"; \
173183
echo "------------------------------------------------------------"; \
174-
if docker run --rm -v $(CURRENT_DIR):/docs \
184+
if docker run --rm \
185+
-v $(CURRENT_DIR):/docs \
186+
-e DELIM_START='$(DELIM_START)' \
187+
-e DELIM_CLOSE='$(DELIM_CLOSE)' \
175188
cytopia/terraform-docs:${TF_DOCS_VERSION} \
176189
terraform-docs-replace --sort-inputs-by-required --with-aggregate-type-defaults md $${DOCKER_PATH}/README.md; then \
177190
echo "OK"; \

0 commit comments

Comments
 (0)