Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion pkg/cmd/extension/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,16 @@ func NewCmdExtension(f *cmdutil.Factory) *cobra.Command {

if ext, err := checkValidExtension(cmd.Root(), m, repo.RepoName(), repo.RepoOwner()); err != nil {
// If an existing extension was found and --force was specified, attempt to upgrade.
// However, if --pin is also set, we should reinstall with the pin rather than
// upgrading, since the user explicitly requested a specific version.
if forceFlag && ext != nil {
return upgradeFunc(ext.Name(), forceFlag)
if pinFlag != "" {
if err := m.Remove(ext.Name()); err != nil {
return err
}
} else {
return upgradeFunc(ext.Name(), forceFlag)
}
}

if errors.Is(err, alreadyInstalledError) {
Expand Down