diff --git a/pkg/cmd/extension/command.go b/pkg/cmd/extension/command.go index 66370305c..ec756edfa 100644 --- a/pkg/cmd/extension/command.go +++ b/pkg/cmd/extension/command.go @@ -76,6 +76,7 @@ func NewCmdExtension(f *cmdutil.Factory) *cobra.Command { if c.UpdateAvailable() { updateAvailable = "Upgrade available" } + t.AddField(updateAvailable, nil, cs.Green) t.EndRow() } return t.Render() diff --git a/pkg/cmd/extension/manager.go b/pkg/cmd/extension/manager.go index 9452c2b53..156212909 100644 --- a/pkg/cmd/extension/manager.go +++ b/pkg/cmd/extension/manager.go @@ -198,13 +198,7 @@ func (m *Manager) parseBinaryExtensionDir(fi fs.FileInfo) (Extension, error) { remoteURL := ghrepo.GenerateRepoURL(repo, "") ext.url = remoteURL ext.currentVersion = bm.Tag -<<<<<<< HEAD - if bm.Pinned { - ext.pin = bm.Tag - } -======= ext.isPinned = bm.IsPinned ->>>>>>> tmp return ext, nil } @@ -214,17 +208,10 @@ func (m *Manager) parseGitExtensionDir(fi fs.FileInfo) (Extension, error) { remoteUrl := m.getRemoteUrl(fi.Name()) currentVersion := m.getCurrentVersion(fi.Name()) -<<<<<<< HEAD - var pinnedVersion string - pinPath := filepath.Join(id, fi.Name(), fmt.Sprintf(".pin-%s", currentVersion)) - if _, err := os.Stat(pinPath); err == nil && len(currentVersion) > 6 { - pinnedVersion = currentVersion[:7] -======= var isPinned bool pinPath := filepath.Join(id, fi.Name(), fmt.Sprintf(".pin-%s", currentVersion)) if _, err := os.Stat(pinPath); err == nil { isPinned = true ->>>>>>> tmp } return Extension{ @@ -233,11 +220,7 @@ func (m *Manager) parseGitExtensionDir(fi fs.FileInfo) (Extension, error) { isLocal: false, currentVersion: currentVersion, kind: GitKind, -<<<<<<< HEAD - pin: pinnedVersion, -======= isPinned: isPinned, ->>>>>>> tmp }, nil } @@ -339,19 +322,11 @@ func (m *Manager) InstallLocal(dir string) error { } type binManifest struct { -<<<<<<< HEAD - Owner string - Name string - Host string - Tag string - Pinned bool -======= Owner string Name string Host string Tag string IsPinned bool ->>>>>>> tmp // TODO I may end up not using this; just thinking ahead to local installs Path string } @@ -423,21 +398,12 @@ func (m *Manager) installBin(repo ghrepo.Interface, target string) error { } manifest := binManifest{ -<<<<<<< HEAD - Name: name, - Owner: repo.RepoOwner(), - Host: repo.RepoHost(), - Path: binPath, - Tag: r.Tag, - Pinned: isPinned, -======= Name: name, Owner: repo.RepoOwner(), Host: repo.RepoHost(), Path: binPath, Tag: r.Tag, IsPinned: isPinned, ->>>>>>> tmp } bs, err := yaml.Marshal(manifest) @@ -501,11 +467,7 @@ func (m *Manager) installGit(repo ghrepo.Interface, target string, stdout, stder pinPath := filepath.Join(targetDir, fmt.Sprintf(".pin-%s", commitSHA)) f, err := os.OpenFile(pinPath, os.O_WRONLY|os.O_CREATE, 0600) if err != nil { -<<<<<<< HEAD - return fmt.Errorf("failed to create pin in directory: %w", err) -======= return fmt.Errorf("failed to create pin file in directory: %w", err) ->>>>>>> tmp } return f.Close() } @@ -569,11 +531,7 @@ func (m *Manager) upgradeExtension(ext Extension, force bool) error { if ext.isLocal { return localExtensionUpgradeError } -<<<<<<< HEAD - if ext.pin != "" { -======= if ext.IsPinned() { ->>>>>>> tmp return pinnedExtensionUpgradeError } if !ext.UpdateAvailable() {