MCPcopy Create free account
hub / github.com/cli/cli / NewManager

Function NewManager

pkg/cmd/extension/manager.go:59–78  ·  view source on GitHub ↗
(ios *iostreams.IOStreams, gc *git.Client)

Source from the content-addressed store, hash-verified

57}
58
59func NewManager(ios *iostreams.IOStreams, gc *git.Client) *Manager {
60 return &Manager{
61 dataDir: config.DataDir,
62 updateDir: func() string {
63 return filepath.Join(config.StateDir(), "extensions")
64 },
65 lookPath: safeexec.LookPath,
66 findSh: findsh.Find,
67 newCommand: exec.Command,
68 platform: func() (string, string) {
69 ext := ""
70 if runtime.GOOS == "windows" {
71 ext = ".exe"
72 }
73 return fmt.Sprintf("%s-%s", runtime.GOOS, runtime.GOARCH), ext
74 },
75 io: ios,
76 gitClient: &gitExecuter{client: gc},
77 }
78}
79
80func (m *Manager) SetConfig(cfg gh.Config) {
81 m.config = cfg

Callers 1

extensionManagerFunction · 0.92

Calls 2

StateDirFunction · 0.92
JoinMethod · 0.80

Tested by

no test coverage detected