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