github
9 of 26 new or added lines in 2 files covered. (34.62%)
24081 of 37160 relevant lines covered (64.8%)
781.12 hits per line
1 |
//go:build !no_metadata
|
|
2 |
|
|
3 |
package app
|
|
4 |
|
|
5 |
import (
|
|
6 |
"os"
|
|
7 |
"path/filepath"
|
|
8 |
|
|
9 |
"fyne.io/fyne/v2"
|
|
10 |
"fyne.io/fyne/v2/internal/metadata"
|
|
11 |
) |
|
12 |
|
|
|
func checkLocalMetadata() {
|
1✔ |
|
file, _ := filepath.Abs("FyneApp.toml")
|
1✔ |
|
ref, err := os.Open(file) |
1✔ |
|
if err != nil { // no worries, this is just an optional fallback |
2✔ |
|
return
|
1✔ |
|
} |
1✔ |
19 |
|
|
NEW
|
data, err := metadata.Load(ref) |
× |
NEW
|
if err != nil || data == nil { |
× |
NEW
|
fyne.LogError("failed to parse FyneApp.toml", err)
|
× |
NEW
|
return
|
× |
NEW
|
} |
× |
25 |
|
|
NEW
|
meta.ID = data.Details.ID |
× |
NEW
|
meta.Name = data.Details.Name |
× |
NEW
|
meta.Version = data.Details.Version |
× |
NEW
|
meta.Build = data.Details.Build |
× |
NEW
|
|
× |
NEW
|
if data.Details.Icon != "" { |
× |
NEW
|
res, err := fyne.LoadResourceFromPath(data.Details.Icon) |
× |
NEW
|
if err == nil { |
× |
NEW
|
meta.Icon = res |
× |
NEW
|
} |
× |
36 |
} |
|
37 |
|
|
NEW
|
meta.Release = false
|
× |
NEW
|
meta.Custom = data.Development |
× |
40 |
} |