(url string, o *plugin.Options)
| 233 | } |
| 234 | |
| 235 | func openBrowser(url string, o *plugin.Options) { |
| 236 | // Construct URL. |
| 237 | baseURL, _ := gourl.Parse(url) |
| 238 | current := currentConfig() |
| 239 | u, _ := current.makeURL(*baseURL) |
| 240 | |
| 241 | // Give server a little time to get ready. |
| 242 | time.Sleep(time.Millisecond * 500) |
| 243 | |
| 244 | for _, b := range browsers() { |
| 245 | args := strings.Split(b, " ") |
| 246 | if len(args) == 0 { |
| 247 | continue |
| 248 | } |
| 249 | viewer := exec.Command(args[0], append(args[1:], u.String())...) |
| 250 | viewer.Stderr = os.Stderr |
| 251 | if err := viewer.Start(); err == nil { |
| 252 | return |
| 253 | } |
| 254 | } |
| 255 | // No visualizer succeeded, so just print URL. |
| 256 | o.UI.PrintErr(u.String()) |
| 257 | } |
| 258 | |
| 259 | // makeReport generates a report for the specified command. |
| 260 | // If configEditor is not null, it is used to edit the config used for the report. |
no test coverage detected
searching dependent graphs…