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

Function NewManager

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

Source from the content-addressed store, hash-verified

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

Callers 1

extensionManagerFunction · 0.92

Calls 2

StateDirFunction · 0.92
JoinMethod · 0.80

Tested by

no test coverage detected