53 lines
928 B
Go
53 lines
928 B
Go
package main
|
|
|
|
import (
|
|
"embed"
|
|
"os"
|
|
|
|
"github.com/wailsapp/wails/v2"
|
|
"github.com/wailsapp/wails/v2/pkg/options"
|
|
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
|
|
)
|
|
|
|
//go:embed all:frontend_dist
|
|
var assets embed.FS
|
|
|
|
func debugEnabled() bool {
|
|
for _, arg := range os.Args[1:] {
|
|
if arg == "--debug" || arg == "-d" {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
func main() {
|
|
debug := debugEnabled()
|
|
if debug {
|
|
println("Debug logging enabled")
|
|
}
|
|
|
|
// Create an instance of the app structure
|
|
app := NewApp(debug)
|
|
|
|
// Create application with options
|
|
err := wails.Run(&options.App{
|
|
Title: "Web News",
|
|
Width: 1280,
|
|
Height: 800,
|
|
AssetServer: &assetserver.Options{
|
|
Assets: assets,
|
|
},
|
|
BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1},
|
|
OnStartup: app.startup,
|
|
Bind: []interface{}{
|
|
app,
|
|
},
|
|
EnableDefaultContextMenu: true,
|
|
})
|
|
|
|
if err != nil {
|
|
println("Error:", err.Error())
|
|
}
|
|
}
|