diff --git a/pkg/plugin/installer/vcs_installer.go b/pkg/plugin/installer/vcs_installer.go index 537aca3e6fcee9db94ffd3c19ada0ee307fe6f2c..ce7a93b83db6e84ffec19d6b45a15ce6d6640d34 100644 --- a/pkg/plugin/installer/vcs_installer.go +++ b/pkg/plugin/installer/vcs_installer.go @@ -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) } } diff --git a/pkg/plugin/plugin.go b/pkg/plugin/plugin.go index d9fbf80ea03e75b6953a8d748a3d3e565aad0ff6..e0f307ace9151d9769f519e94dd275351e9585ce 100644 --- a/pkg/plugin/plugin.go +++ b/pkg/plugin/plugin.go @@ -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 }