Skip to content

Commit

Permalink
Fix regex escape (hashicorp#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
cosandr committed Jan 21, 2022
1 parent e635a24 commit 22b7d7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion post-processor/vsphere-template/step_mark_as_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func datastorePath(vm *object.VirtualMachine) (*object.DatastorePath, error) {
return nil, fmt.Errorf("disk not found in '%v'", vm.Name())
}

re := regexp.MustCompile(`\\[(.*?)\\]`)
re := regexp.MustCompile(`\[(.*?)\]`)

datastore := re.FindStringSubmatch(disk)[1]
vmxPath := path.Join("/", path.Dir(strings.Split(disk, " ")[1]), vm.Name()+".vmx")
Expand Down

0 comments on commit 22b7d7a

Please sign in to comment.