From 4d0a890d2eb5f8af8372b278007d3256d31d2cf6 Mon Sep 17 00:00:00 2001 From: cytopia Date: Sun, 30 Jun 2019 13:10:54 +0200 Subject: [PATCH] Fix: Do not double quote TF >= 0.12 legacy quoted types --- bin/terraform-docs.awk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/terraform-docs.awk b/bin/terraform-docs.awk index 58964644..bd6b2b7f 100644 --- a/bin/terraform-docs.awk +++ b/bin/terraform-docs.awk @@ -61,7 +61,12 @@ if (type ~ "object") { print " type = \"object\"" } else { - print " type = \"" $3 "\"" + # legacy quoted types: "string", "list", and "map" + if ($3 ~ /^[[:space:]]*"(.*?)"[[:space:]]*$/) { + print " type = " $3 + } else { + print " type = \"" $3 "\"" + } } } }