packer fix: state that the command does not work for hcl files (#11238)

This commit is contained in:
Adrien Delorme
2021-08-31 16:12:47 +02:00
committed by GitHub
parent d25373a8d6
commit c083b53c4f
+4
View File
@@ -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 {