Skip to content

Commit

Permalink
Merge pull request #42 from AnthonyNixon/Upgrade
Browse files Browse the repository at this point in the history
fix(updater): handle no-op for updating gracefully
  • Loading branch information
AnthonyNixon authored Dec 2, 2022
2 parents 4bb2419 + e6ff53f commit f5e9c4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions aoc-boilerplate/updater/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ func Update(newVer string, currentVer string, build string) (err error) {
}
fmt.Printf("Latest Tag found: %s\n", newVer)
}

fmt.Printf("'%s' == '%s'", newVer, currentVer)
if newVer == currentVer {
return errors.New(UpToDateMessage)
}
Expand Down
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ func main() {
case update.FullCommand():
err := updater.Update(*updateVersion, GetVersion(), GetBuild())
if err != nil {
if err.Error() != updater.UpToDateMessage {
if err.Error() == updater.UpToDateMessage {
println(updater.UpToDateMessage)
} else {
panic(err)
}
}
Expand Down

0 comments on commit f5e9c4c

Please sign in to comment.