Skip to content

Commit

Permalink
add an option for windows user to disable open FAQ feature
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed Mar 5, 2024
1 parent 68854af commit eaed01b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ type AdvancedConfig struct {
WaitBeforeEnable int `yaml:"wait-before-enable"`

DoNotRedirectHTTPSToSecureHostname bool `yaml:"do-NOT-redirect-https-to-SECURE-hostname"`
DoNotOpenFAQOnWindows bool `yaml:"do-not-open-faq-on-windows"`
}

type CertificateConfig struct {
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ import (
"net"
"net/http"
"os"
"os/exec"
"os/signal"
"path/filepath"
"runtime"
"strings"
"syscall"
"time"
"os/exec"

"runtime/pprof"

Expand Down Expand Up @@ -115,7 +115,7 @@ func main() {
if code != 0 {
log.Errorf("Program exiting with code %d", exitCode)
log.Error("Please read https://github.com/LiterMC/go-openbmclapi?tab=readme-ov-file#faq before report your issue")
if runtime.GOOS == "windows" {
if runtime.GOOS == "windows" && !config.Advanced.DoNotOpenFAQOnWindows {
log.Warnf("Detected that you are in windows environment, we are helping you to open the browser")
exec.Command("explorer", "https://github.com/LiterMC/go-openbmclapi?tab=readme-ov-file#faq").Start()
time.Sleep(time.Hour)
Expand Down

0 comments on commit eaed01b

Please sign in to comment.