mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-20 09:39:08 +00:00
Added Linux $PATH support and fixed FlagSet typo
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
This commit is contained in:
parent
eae5422a0d
commit
b6e8d4fd63
@ -58,7 +58,7 @@ guestOS = "other3xlinux-64"
|
||||
`
|
||||
|
||||
func runVMware(args []string) {
|
||||
vmwareArgs := flag.NewFlagSet("hyperkit", flag.ExitOnError)
|
||||
vmwareArgs := flag.NewFlagSet("vmware", flag.ExitOnError)
|
||||
vmwareArgs.Usage = func() {
|
||||
fmt.Printf("USAGE: %s run vmware [options] prefix\n\n", os.Args[0])
|
||||
fmt.Printf("'prefix' specifies the path to the VM image.\n")
|
||||
@ -102,6 +102,16 @@ func runVMware(args []string) {
|
||||
vmrunArgs = []string{"-T", "fusion", "start", prefix + ".vmx"}
|
||||
}
|
||||
|
||||
if runtime.GOOS == "linux" {
|
||||
path = "vmrun"
|
||||
fullVMrunPath, err := exec.LookPath(path)
|
||||
if err != nil {
|
||||
log.Fatalf("Unable to find %s within the $PATH", path)
|
||||
}
|
||||
path = fullVMrunPath
|
||||
vmrunArgs = []string{"-T", "ws", "start", prefix + ".vmx"}
|
||||
}
|
||||
|
||||
// Check executables exist before attempting to execute
|
||||
if _, err := os.Stat(path); os.IsNotExist(err) {
|
||||
log.Fatalf("ERROR VMware exectuables can not be found, ensure software is installed")
|
||||
|
Loading…
Reference in New Issue
Block a user