Skip to content
This repository was archived by the owner on Jan 16, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion ios_symbol_uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"bytes"
"fmt"
"net/http"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -177,7 +178,12 @@ func (i *iosSymbolUploader) symbolConversionTool(baseDir string,
if updater == nil {
if toUpdate {
fmt.Fprintln(e.Out, "Fetching required resources...")
err, _ = update.New().Target(toolPath).FromUrl(osxSymbolConverterDownloadURL)
var resp *http.Response
resp, err = http.Get(osxSymbolConverterDownloadURL)
if err == nil {
defer resp.Body.Close()
err = update.Apply(resp.Body, &update.Options{TargetPath: toolPath})
}
}
} else {
err = updater(toolPath, osxSymbolConverterDownloadURL)
Expand Down
10 changes: 8 additions & 2 deletions update_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,14 @@ func (u *updateCmd) updateCLI(e *env) (bool, error) {
}

fmt.Fprintf(e.Out, "Downloading binary from %s.\n", downloadURL)
if err, _ := update.New().Target(exec).FromUrl(downloadURL); err != nil {
return false, stackerr.Newf("Update failed: %v", err)
resp, err := http.Get(downloadURL)
if err != nil {
return false, stackerr.Newf("Update failed with error: %v", err)
}
defer resp.Body.Close()
err = update.Apply(resp.Body, &update.Options{TargetPath: exec})
if err != nil {
return false, stackerr.Newf("Update failed with error: %v", err)
}
fmt.Fprintf(e.Out, "Successfully updated binary at: %s\n", exec)
return true, nil
Expand Down