From c083b53c4f59bd243cdd5c25fd63f2eeeab194cb Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 31 Aug 2021 16:12:47 +0200 Subject: [PATCH] packer fix: state that the command does not work for hcl files (#11238) --- command/fix.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/command/fix.go b/command/fix.go index 33e2a970e..db5f62fc4 100644 --- a/command/fix.go +++ b/command/fix.go @@ -50,6 +50,10 @@ func (c *FixCommand) ParseArgs(args []string) (*FixArgs, int) { } func (c *FixCommand) RunContext(ctx context.Context, cla *FixArgs) int { + if hcl2, _ := isHCLLoaded(cla.Path); hcl2 { + c.Ui.Error("packer fix only works with JSON files for now.") + return 1 + } // Read the file for decoding tplF, err := os.Open(cla.Path) if err != nil {