Skip to content

Commit 7a6f6c1

Browse files
committed
Fix missing footer-from if set via CLI flag or config
This is to fix a small regression where footer-from isn't processed properly, neither when it's passed via CLI flag nor in a config file. Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
1 parent 9c738b9 commit 7a6f6c1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

internal/cli/config.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,9 @@ func (c *Config) process() {
338338
c.Sections.requirements = c.Sections.visibility("requirements")
339339
c.Sections.resources = c.Sections.visibility("resources")
340340

341-
// Footer section optional and should not cause error with --show-all
342-
if c.Sections.ShowAll && c.Sections.footer {
341+
// Footer section is optional and should only be enabled if --footer-from
342+
// is explicitly set, either via CLI or config file.
343+
if c.FooterFrom == "" && !changedfs["footer-from"] {
343344
c.Sections.footer = false
344345
}
345346
}
@@ -403,16 +404,16 @@ func (c *Config) extract() (*print.Settings, *terraform.Options) {
403404
options := terraform.NewOptions()
404405

405406
// header-from
407+
settings.ShowHeader = c.Sections.header
406408
options.ShowHeader = settings.ShowHeader
407409
options.HeaderFromFile = c.HeaderFrom
408410

409411
// footer-from
412+
settings.ShowFooter = c.Sections.footer
410413
options.ShowFooter = settings.ShowFooter
411414
options.FooterFromFile = c.FooterFrom
412415

413416
// sections
414-
settings.ShowHeader = c.Sections.header
415-
settings.ShowFooter = c.Sections.footer
416417
settings.ShowInputs = c.Sections.inputs
417418
settings.ShowModuleCalls = c.Sections.modulecalls
418419
settings.ShowOutputs = c.Sections.outputs

0 commit comments

Comments
 (0)