Open browser on startup automatically, with configuration option to disable.
This commit is contained in:
7
dau.go
7
dau.go
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user