(ios *iostreams.IOStreams, gc *git.Client)
| 56 | } |
| 57 | |
| 58 | func 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 | |
| 79 | func (m *Manager) SetConfig(cfg gh.Config) { |
| 80 | m.config = cfg |
no test coverage detected