Skip to content

Commit 0248ba2

Browse files
committed
Print generated pre-0.12 hcl to stderr on error
1 parent d43bb00 commit 0248ba2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

data/docker-entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ if [ "${#}" -ge "1" ]; then
115115
# Get terraform-docs output
116116
>&2 echo "terraform-docs-012 ${*} ${WORKDIR}"
117117
if ! DOCS="$(terraform-docs "${@}" "/tmp-012")"; then
118-
cat -n /tmp-012/tmp.tf
118+
cat -n "/tmp-012/tmp.tf" >&2
119119
exit 1
120120
fi
121121
fi
@@ -153,7 +153,10 @@ if [ "${#}" -ge "1" ]; then
153153
# Remove first argument (terraform-docs-012)
154154
shift
155155
# Execute
156-
exec terraform-docs "${@}" "/tmp-012/"
156+
if ! terraform-docs "${@}" "/tmp-012/"; then
157+
cat -n "/tmp-012/tmp.tf" >&2
158+
exit 1
159+
fi
157160

158161
###
159162
### Unsupported command

0 commit comments

Comments
 (0)