mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 18:11:35 +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) {
|
func runVMware(args []string) {
|
||||||
vmwareArgs := flag.NewFlagSet("hyperkit", flag.ExitOnError)
|
vmwareArgs := flag.NewFlagSet("vmware", flag.ExitOnError)
|
||||||
vmwareArgs.Usage = func() {
|
vmwareArgs.Usage = func() {
|
||||||
fmt.Printf("USAGE: %s run vmware [options] prefix\n\n", os.Args[0])
|
fmt.Printf("USAGE: %s run vmware [options] prefix\n\n", os.Args[0])
|
||||||
fmt.Printf("'prefix' specifies the path to the VM image.\n")
|
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"}
|
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
|
// Check executables exist before attempting to execute
|
||||||
if _, err := os.Stat(path); os.IsNotExist(err) {
|
if _, err := os.Stat(path); os.IsNotExist(err) {
|
||||||
log.Fatalf("ERROR VMware exectuables can not be found, ensure software is installed")
|
log.Fatalf("ERROR VMware exectuables can not be found, ensure software is installed")
|
||||||
|
Loading…
Reference in New Issue
Block a user