logging, config file managment, writing library dir
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"embed"
|
||||
"fmt"
|
||||
|
||||
"yellowjacket/backend/config"
|
||||
|
||||
"github.com/wailsapp/wails/v2"
|
||||
"github.com/wailsapp/wails/v2/pkg/logger"
|
||||
"github.com/wailsapp/wails/v2/pkg/options"
|
||||
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
|
||||
)
|
||||
@@ -12,24 +17,30 @@ import (
|
||||
var assets embed.FS
|
||||
|
||||
func main() {
|
||||
// Create an instance of the app structure
|
||||
app := NewApp()
|
||||
config, err := config.GetCurrentConfig()
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("could not get config: %w", err))
|
||||
}
|
||||
|
||||
app := NewApp(config)
|
||||
|
||||
// Create application with options
|
||||
err := wails.Run(&options.App{
|
||||
err = wails.Run(&options.App{
|
||||
Title: "yellowjacket",
|
||||
Width: 1024,
|
||||
Height: 768,
|
||||
Width: 512,
|
||||
Height: 384,
|
||||
AssetServer: &assetserver.Options{
|
||||
Assets: assets,
|
||||
},
|
||||
LogLevel: logger.INFO,
|
||||
BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1},
|
||||
OnStartup: app.startup,
|
||||
OnStartup: func(ctx context.Context) {
|
||||
app.startup(ctx)
|
||||
},
|
||||
Bind: []interface{}{
|
||||
app,
|
||||
},
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
println("Error:", err.Error())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user