Skip to content

Commit

Permalink
fixing for mac and linux as well
Browse files Browse the repository at this point in the history
  • Loading branch information
akhil authored and akhil committed Mar 20, 2024
1 parent 975f086 commit 637934f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
*.iml
.vscode/
vermin.exe
vermin.exe
vermin
6 changes: 4 additions & 2 deletions hypervisor/virtualbox/virtualbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func (*virtualbox) Commit(vmName, imageName string) error {
func (*virtualbox) Create(imageName, vmName string, cpus int, mem int) error {

imagePath := db.GetImageFilePath(imageName)

importArgs := []string{
"import",
imagePath,
Expand All @@ -51,8 +50,11 @@ func (*virtualbox) Create(imageName, vmName string, cpus int, mem int) error {
"--memory", strconv.Itoa(mem),
}

// Wrap each argument in quotes if it contains spaces
for i, arg := range importArgs {
importArgs[i] = `"` + arg + `"`
if strings.Contains(arg, " ") {
importArgs[i] = `"` + arg + `"`
}
}

importCmd := vboxManage(importArgs...)
Expand Down

0 comments on commit 637934f

Please sign in to comment.