Skip to content

Commit f18dd3b

Browse files
author
Adam Ross
committed
Skip NFS file sharing outside mac OS.
1 parent e3578ff commit f18dd3b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

cli/commands/start.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package commands
22

33
import (
44
"os/exec"
5+
"runtime"
56
"strconv"
67

78
"github.com/phase2/rig/cli/util"
@@ -82,11 +83,14 @@ func (cmd *Start) Run(c *cli.Context) error {
8283
dns := Dns{BaseCommand{machine: cmd.machine, out: cmd.out}}
8384
dns.ConfigureDns(cmd.machine, c.String("nameservers"))
8485

85-
cmd.out.Verbose.Println("Enabling NFS file sharing")
86-
if nfsErr := util.StreamCommand(exec.Command("docker-machine-nfs", cmd.machine.Name)); nfsErr != nil {
87-
cmd.out.Error.Printf("Error enabling NFS: %s", nfsErr)
86+
// NFS mounts are Mac-only.
87+
if runtime.GOOS == "darwin" {
88+
cmd.out.Verbose.Println("Enabling NFS file sharing")
89+
if nfsErr := util.StreamCommand(exec.Command("docker-machine-nfs", cmd.machine.Name)); nfsErr != nil {
90+
cmd.out.Error.Printf("Error enabling NFS: %s", nfsErr)
91+
}
92+
cmd.out.Verbose.Println("NFS is ready to use")
8893
}
89-
cmd.out.Verbose.Println("NFS is ready to use")
9094

9195
// NFS enabling may have caused a machine restart, wait for it to be available before proceeding
9296
cmd.machine.WaitForDev()

0 commit comments

Comments
 (0)