Skip to content

Commit

Permalink
Merge pull request #420 from paran01d/browser_auto_launch_flag
Browse files Browse the repository at this point in the history
Added a new flag launchBrowser defaulted to true
  • Loading branch information
ruzz311 committed May 3, 2016
2 parents cc5d85f + c1c78c9 commit a0c45c7
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions goconvey.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func flags() {
flag.StringVar(&watchedSuffixes, "watchedSuffixes", ".go", "A comma separated list of file suffixes to watch for modifications (default: .go).")
flag.StringVar(&excludedDirs, "excludedDirs", "vendor,node_modules", "A comma separated list of directories that will be excluded from being watched")
flag.StringVar(&workDir, "workDir", "", "set goconvey working directory (default current directory)")
flag.BoolVar(&autoLaunchBrowser, "launchBrowser", true, "toggle auto launching of browser (default: true)")

log.SetOutput(os.Stdout)
log.SetFlags(log.LstdFlags | log.Lshortfile)
Expand Down Expand Up @@ -78,7 +79,9 @@ func main() {
listener := createListener()
go runTestOnUpdates(watcherOutput, executor, server)
go watcher.Listen()
go launchBrowser(listener.Addr().String())
if autoLaunchBrowser {
go launchBrowser(listener.Addr().String())
}
serveHTTP(server, listener)
}

Expand Down Expand Up @@ -267,16 +270,17 @@ func getWorkDir() string {
}

var (
port int
host string
gobin string
nap time.Duration
packages int
cover bool
depth int
timeout string
watchedSuffixes string
excludedDirs string
port int
host string
gobin string
nap time.Duration
packages int
cover bool
depth int
timeout string
watchedSuffixes string
excludedDirs string
autoLaunchBrowser bool

static string
reports string
Expand Down

0 comments on commit a0c45c7

Please sign in to comment.