X Tutup
Skip to content

Commit 0e2861a

Browse files
author
vilmibm
committed
WIP refactoring
1 parent f5d269e commit 0e2861a

File tree

3 files changed

+4
-110
lines changed

3 files changed

+4
-110
lines changed

pkg/cmd/extension/manager.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func (m *Manager) Install(client *http.Client, repo ghrepo.Interface, io *iostre
195195
return fmt.Errorf("could not check for binary extension: %w", err)
196196
}
197197
if isBin {
198-
return m.InstallBin(client, repo)
198+
return m.installBin(client, repo)
199199
}
200200

201201
hs, err := hasScript(client, repo)
@@ -208,10 +208,10 @@ func (m *Manager) Install(client *http.Client, repo ghrepo.Interface, io *iostre
208208
}
209209

210210
protocol, _ := cfg.Get(repo.RepoHost(), "git_protocol")
211-
return m.InstallGit(ghrepo.FormatRemoteURL(repo, protocol), io.Out, io.ErrOut)
211+
return m.installGit(ghrepo.FormatRemoteURL(repo, protocol), io.Out, io.ErrOut)
212212
}
213213

214-
func (m *Manager) InstallBin(client *http.Client, repo ghrepo.Interface) error {
214+
func (m *Manager) installBin(client *http.Client, repo ghrepo.Interface) error {
215215
var r *release
216216
r, err := fetchLatestRelease(client, repo)
217217
if err != nil {
@@ -276,7 +276,7 @@ func (m *Manager) InstallBin(client *http.Client, repo ghrepo.Interface) error {
276276
return nil
277277
}
278278

279-
func (m *Manager) InstallGit(cloneURL string, stdout, stderr io.Writer) error {
279+
func (m *Manager) installGit(cloneURL string, stdout, stderr io.Writer) error {
280280
exe, err := m.lookPath("git")
281281
if err != nil {
282282
return err

pkg/extensions/extension.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ type Extension interface {
2222
type ExtensionManager interface {
2323
List(includeMetadata bool) []Extension
2424
Install(*http.Client, ghrepo.Interface, *iostreams.IOStreams, config.Config) error
25-
InstallBin(*http.Client, ghrepo.Interface) error
26-
InstallGit(string, io.Writer, io.Writer) error
2725
InstallLocal(dir string) error
2826
Upgrade(name string, force bool, stdout, stderr io.Writer) error
2927
Remove(name string) error

pkg/extensions/manager_mock.go

Lines changed: 0 additions & 104 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
X Tutup