Merge pull request #2236 from adamreese/ref/plugin-remote

ref(plugin): cleanup unused functions
pull/1641/merge
Adam Reese 8 years ago committed by GitHub
commit 9856c23459

@ -92,7 +92,7 @@ func (i *VCSInstaller) solveVersion(repo vcs.Repo) (string, error) {
return "", err
}
// Get the tags and branches (in that order)
// Get the tags
refs, err := repo.Tags()
if err != nil {
return "", err
@ -136,8 +136,7 @@ func (i *VCSInstaller) sync(repo vcs.Repo) error {
func getSemVers(refs []string) []*semver.Version {
var sv []*semver.Version
for _, r := range refs {
v, err := semver.NewVersion(r)
if err == nil {
if v, err := semver.NewVersion(r); err == nil {
sv = append(sv, v)
}
}

@ -21,7 +21,6 @@ import (
"path/filepath"
"strings"
"github.com/Masterminds/vcs"
"github.com/ghodss/yaml"
)
@ -76,17 +75,6 @@ type Plugin struct {
Metadata *Metadata
// Dir is the string path to the directory that holds the plugin.
Dir string
// Remote is the remote repo location.
Remote string
}
func detectSource(dirname string) (string, error) {
if repo, err := vcs.NewRepo("", dirname); err == nil {
if repo.CheckLocal() {
return repo.Remote(), nil
}
}
return os.Readlink(dirname)
}
// PrepareCommand takes a Plugin.Command and prepares it for execution.
@ -116,10 +104,6 @@ func LoadDir(dirname string) (*Plugin, error) {
}
plug := &Plugin{Dir: dirname}
if src, err := detectSource(dirname); err == nil {
plug.Remote = src
}
if err := yaml.Unmarshal(data, &plug.Metadata); err != nil {
return nil, err
}

Loading…
Cancel
Save