Skip to content

Commit

Permalink
fix: default desktop mode opens the browser.
Browse files Browse the repository at this point in the history
- Cross compilation becomes A LOT more complicated
  once CGO is in the mix. Requires the time and energy
  to get build scripts to work across all platforms, and
  update the automated Github Actions to build on
  multiple machines (MacOS requires MacOS runner,
  Windows / Linux require Linux runner)
- This commit adds a build flag "webview" to enable
  webview desktop support but the default without
  the build flag is to open the browser on start.
  • Loading branch information
evan-buss committed Jun 18, 2022
1 parent 62a7a4c commit 8068c1a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions desktop/desktop.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build !webview
// +build !webview

package desktop

import "github.com/evan-buss/openbooks/util"

func StartWebView(url string, debug bool) {
util.OpenBrowser(url)
}
3 changes: 2 additions & 1 deletion desktop/desktop_unix.go → desktop/desktop_webview.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build !windows
//go:build !windows && webview
// +build !windows,webview

package desktop

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build windows
//go:build windows && webview
// +build windows,webview

package desktop

Expand Down

0 comments on commit 8068c1a

Please sign in to comment.