Open browser on startup automatically, with configuration option to disable.

This commit is contained in:
2022-05-01 11:55:20 +09:30
parent 0c2fafdc7a
commit 06ac259e0a
10 changed files with 57 additions and 12 deletions

7
dau.go
View File

@@ -21,6 +21,8 @@ import (
daulog "github.com/tardisx/discord-auto-upload/log"
"github.com/tardisx/discord-auto-upload/upload"
"github.com/skratchdot/open-golang/open"
// "github.com/tardisx/discord-auto-upload/upload"
"github.com/tardisx/discord-auto-upload/version"
"github.com/tardisx/discord-auto-upload/web"
@@ -51,6 +53,11 @@ func main() {
web := web.WebService{Config: config, Uploader: up}
web.StartWebServer()
if config.Config.OpenBrowserOnStart {
address := fmt.Sprintf("http://localhost:%d", config.Config.Port)
open.Start(address)
}
go func() {
version.GetOnlineVersion()
if version.UpdateAvailable() {