Fixed enquoted types in terraform_docs (fixed #52)

This commit is contained in:
Anton Babenko 2019-06-25 14:34:46 +02:00
commit 83629157c2

View file

@ -168,11 +168,16 @@ terraform_docs_awk() {
type=$3 type=$3
if (type ~ "object") { if (type ~ "object") {
print " type = \"object\"" print " type = \"object\""
} else {
# legacy quoted types: "string", "list", and "map"
if ($3 ~ /^[[:space:]]*"(.*?)"[[:space:]]*$/) {
print " type = " $3
} else { } else {
print " type = \"" $3 "\"" print " type = \"" $3 "\""
} }
} }
} }
}
# [CLOSE] variable/output block # [CLOSE] variable/output block
if (blockCnt > 0) { if (blockCnt > 0) {