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 {