Skip to content

Commit

Permalink
feat: show version on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyXiang committed Mar 13, 2022
1 parent 0be86d8 commit 7933559
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ build:
- CGO_ENABLED=0
ldflags:
- -s -w
- -X "main.Version={{ .Version }}"
flags:
- -trimpath

Expand Down
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import (
"github.com/RoyXiang/plexproxy/handler"
)

var (
Version string
)

func main() {
srv := &http.Server{
Addr: "0.0.0.0:5000",
Expand All @@ -23,7 +27,7 @@ func main() {
common.GetLogger().Println(err)
}
}()
common.GetLogger().Println("Server started on :5000")
common.GetLogger().Printf("plexproxy started on :5000 (version=%q)", Version)

c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
Expand Down

0 comments on commit 7933559

Please sign in to comment.