(appVersion string, invokingAgent string, cfgFunc func() (gh.Config, error), ios *iostreams.IOStreams, executablePath string, telemetryDisabler ghtelemetry.Disabler)
| 27 | var ssoURLRE = regexp.MustCompile(`\burl=([^;]+)`) |
| 28 | |
| 29 | func New(appVersion string, invokingAgent string, cfgFunc func() (gh.Config, error), ios *iostreams.IOStreams, executablePath string, telemetryDisabler ghtelemetry.Disabler) *cmdutil.Factory { |
| 30 | // Inject the OAuth token refresher into the AuthConfig so refreshable credentials can be renewed during ordinary |
| 31 | // commands. It is wrapped around cfgFunc before anything else so every consumer resolves the same refresher-aware |
| 32 | // configuration. |
| 33 | cfgFunc = configWithTokenRefresher(cfgFunc, tokenRefresherHttpClientFunc(ios, appVersion, invokingAgent, telemetryDisabler)) |
| 34 | |
| 35 | f := &cmdutil.Factory{ |
| 36 | AppVersion: appVersion, |
| 37 | InvokingAgent: invokingAgent, |
| 38 | Config: cfgFunc, |
| 39 | ExecutablePath: executablePath, |
| 40 | } |
| 41 | |
| 42 | f.IOStreams = ios |
| 43 | f.TelemetryDisabler = telemetryDisabler |
| 44 | f.HttpClient = HttpClientFunc(cfgFunc, ios, appVersion, invokingAgent, telemetryDisabler) |
| 45 | f.PlainHttpClient = plainHttpClientFunc(ios, appVersion, invokingAgent, telemetryDisabler) |
| 46 | f.ExternalHttpClient = externalHttpClientFunc(ios, appVersion) |
| 47 | f.GitClient = newGitClient(f) // Depends on IOStreams, and Executable |
| 48 | f.Remotes = remotesFunc(f) // Depends on Config, and GitClient |
| 49 | f.BaseRepo = BaseRepoFunc(f.Remotes) |
| 50 | f.Prompter = newPrompter(f) // Depends on Config and IOStreams |
| 51 | f.Browser = newBrowser(f) // Depends on Config, and IOStreams |
| 52 | f.ExtensionManager = extensionManager(f) // Depends on Config, HttpClient, and IOStreams |
| 53 | f.Branch = branchFunc(f) // Depends on GitClient |
| 54 | |
| 55 | return f |
| 56 | } |
| 57 | |
| 58 | // BaseRepoFunc requests a list of Remotes, and selects the first one. |
| 59 | // Although Remotes is injected via the factory so it looks like the function might |
no test coverage detected