logging, config file managment, writing library dir

This commit is contained in:
2025-03-22 16:33:04 -05:00
parent 26c02b27ff
commit e3f47c602f
7 changed files with 201 additions and 98 deletions
+18 -7
View File
@@ -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())
}