Skip to content

Commit

Permalink
Simplify version value fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
hjr265 committed Sep 14, 2023
1 parent cc9a816 commit b3bd25c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ func main() {
fmt.Fprintln(log.Writer(), "For Toph, By Furqan Software (https://furqansoftware.com)")
fmt.Fprintln(log.Writer())

if version == "" {
version = "devel"
if version != "" {
fmt.Fprintf(log.Writer(), "» Release: %s", version)
} else {
fmt.Fprint(log.Writer(), "» Release: devel")
}
fmt.Fprintf(log.Writer(), "» Release: %s", version)
if date != "" {
fmt.Fprintf(log.Writer(), " (%s)", date)
}
Expand Down Expand Up @@ -195,7 +196,7 @@ func main() {

func catch(err error) {
if err != nil {
if version == "devel" {
if version == "" {
panic(err)
} else {
pog.Fatalln("Fatal error:", err)
Expand Down
2 changes: 1 addition & 1 deletion update.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

func checkUpdate(ctx context.Context) error {
if version == "" || version == "devel" {
if version == "" {
return nil
}

Expand Down

0 comments on commit b3bd25c

Please sign in to comment.