Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Commit

Permalink
added err information to update
Browse files Browse the repository at this point in the history
  • Loading branch information
ojkelly committed Jul 13, 2018
1 parent 0e05f30 commit b88a0e1
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions internal/core/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ func Update(currentVersion string, noPrompt bool) {
return
}

printer.SubStep(
fmt.Sprintf("Found release %s", *latestRelease.TagName),
1,
false,
true,
)

var confirm bool

if noPrompt == false {
Expand All @@ -55,13 +62,6 @@ func Update(currentVersion string, noPrompt bool) {
confirm = true
}

printer.SubStep(
fmt.Sprintf("Found release %s", *latestRelease.TagName),
1,
false,
true,
)

if confirm {
printer.Progress(fmt.Sprintf("Downloading %s", downloadURL))

Expand All @@ -71,7 +71,7 @@ func Update(currentVersion string, noPrompt bool) {
downloadRelease(downloadURL)

printer.SubStep(
fmt.Sprintf("Updated successful."),
fmt.Sprintf("Update successful."),
1,
true,
true,
Expand Down Expand Up @@ -111,8 +111,8 @@ func checkForUpdate(
if err != nil {
printer.Fatal(
err,
"",
"",
"This may have failed due to network connectivity. Try updating again, but it fails download the latest version directly.",
"https://www.kombustion.io/docs/downloads/",
)
}

Expand Down Expand Up @@ -207,7 +207,11 @@ func extractRelease(url, fileName string) (string, error) {
}
err := extracter.Open(fileName, destination)
if err != nil {
printer.Fatal(err, "", "")
printer.Fatal(
err,
"An error occured installing the new release. Try again, or download the latest release directly.",
"https://www.kombustion.io/docs/downloads/",
)
}

return destination, err
Expand Down

0 comments on commit b88a0e1

Please sign in to comment.