Skip to content
This repository was archived by the owner on Jan 16, 2021. It is now read-only.

Commit fb751be

Browse files
committed
Merge pull request #17 from pavanka/fix_update
api of update changed in upstream library. fix it
2 parents 453fa27 + 918bf9d commit fb751be

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

ios_symbol_uploader.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"bytes"
55
"fmt"
6+
"net/http"
67
"os"
78
"os/exec"
89
"path/filepath"
@@ -177,7 +178,12 @@ func (i *iosSymbolUploader) symbolConversionTool(baseDir string,
177178
if updater == nil {
178179
if toUpdate {
179180
fmt.Fprintln(e.Out, "Fetching required resources...")
180-
err, _ = update.New().Target(toolPath).FromUrl(osxSymbolConverterDownloadURL)
181+
var resp *http.Response
182+
resp, err = http.Get(osxSymbolConverterDownloadURL)
183+
if err == nil {
184+
defer resp.Body.Close()
185+
err = update.Apply(resp.Body, &update.Options{TargetPath: toolPath})
186+
}
181187
}
182188
} else {
183189
err = updater(toolPath, osxSymbolConverterDownloadURL)

update_cmd.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,14 @@ func (u *updateCmd) updateCLI(e *env) (bool, error) {
6565
}
6666

6767
fmt.Fprintf(e.Out, "Downloading binary from %s.\n", downloadURL)
68-
if err, _ := update.New().Target(exec).FromUrl(downloadURL); err != nil {
69-
return false, stackerr.Newf("Update failed: %v", err)
68+
resp, err := http.Get(downloadURL)
69+
if err != nil {
70+
return false, stackerr.Newf("Update failed with error: %v", err)
71+
}
72+
defer resp.Body.Close()
73+
err = update.Apply(resp.Body, &update.Options{TargetPath: exec})
74+
if err != nil {
75+
return false, stackerr.Newf("Update failed with error: %v", err)
7076
}
7177
fmt.Fprintf(e.Out, "Successfully updated binary at: %s\n", exec)
7278
return true, nil

0 commit comments

Comments
 (0)