This removes sensitivity to the BROWSER environment variable in tests and makes it easier to verify the URL that the browser was invoked with without having to stub sub-processes.
28 lines
599 B
Go
28 lines
599 B
Go
package cmdutil
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/cli/cli/context"
|
|
"github.com/cli/cli/internal/config"
|
|
"github.com/cli/cli/internal/ghrepo"
|
|
"github.com/cli/cli/pkg/iostreams"
|
|
)
|
|
|
|
type Browser interface {
|
|
Browse(string) error
|
|
}
|
|
|
|
type Factory struct {
|
|
IOStreams *iostreams.IOStreams
|
|
Browser Browser
|
|
|
|
HttpClient func() (*http.Client, error)
|
|
BaseRepo func() (ghrepo.Interface, error)
|
|
Remotes func() (context.Remotes, error)
|
|
Config func() (config.Config, error)
|
|
Branch func() (string, error)
|
|
|
|
// Executable is the path to the currently invoked gh binary
|
|
Executable string
|
|
}
|