Skip to content

Commit

Permalink
On confluent update, no longer remove CLI if path is different (#1833)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianstrauch authored Mar 31, 2023
1 parent cea6026 commit 69e4c07
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions internal/pkg/update/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ func (c *client) UpdateBinary(cliName, version, path string, noVerify bool) erro
newPath := filepath.Join(filepath.Dir(path), cliName)

if c.OS == "windows" {
newPath += ".exe"

// The old version will get deleted automatically eventually as we put it in the system's or user's temp dir
previousVersionBinary := filepath.Join(downloadDir, cliName+".old")
err = c.fs.Move(path, previousVersionBinary)
Expand Down Expand Up @@ -299,13 +301,6 @@ func (c *client) UpdateBinary(cliName, version, path string, noVerify bool) erro
return errors.Wrapf(err, errors.ChmodErrorMsg, newPath)
}

// After updating `ccloud` to `confluent`, remove `ccloud`.
if newPath != path {
if err := c.fs.Remove(path); err != nil {
return errors.Wrapf(err, "unable to remove %s", path)
}
}

return nil
}

Expand Down

0 comments on commit 69e4c07

Please sign in to comment.