MCPcopy
hub / github.com/cli/cli / NewManager

Function NewManager

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

Source from the content-addressed store, hash-verified

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

Callers 1

extensionManagerFunction · 0.92

Calls 2

StateDirFunction · 0.92
JoinMethod · 0.80

Tested by

no test coverage detected