Skip to content

Commit

Permalink
Fixed extraction in self-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Oct 2, 2024
1 parent 24c6501 commit 0276b81
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/uniget/self-upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,14 @@ var selfUpgradeCmd = &cobra.Command{
return fmt.Errorf("failed to remove %s: %s", selfExe, err)
}

body, err := io.ReadAll(resp.Body)
bodyGz, err := io.ReadAll(resp.Body)
if err != nil {
return fmt.Errorf("failed to read body: %s", err)
}
body, err := archive.Gunzip(bodyGz)
if err != nil {
return fmt.Errorf("failed to gunzip body: %s", err)
}
err = archive.ProcessTarContents(body, func(tar *tar.Reader, header *tar.Header) error {
if header.Name == "uniget" {
logging.Debugf("Extracting %s", header.Name)
Expand Down

0 comments on commit 0276b81

Please sign in to comment.