mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 22:55:48 +01:00
use path to first index.html file for 'index' (#1127)
This commit is contained in:
parent
de7f08357c
commit
e39f3eba44
1 changed files with 8 additions and 1 deletions
|
|
@ -417,7 +417,14 @@ func FindPathToFile(fsys fs.FS, file string) (string, error) {
|
|||
}
|
||||
|
||||
if indexFiles.Length() > 1 {
|
||||
return "", fmt.Errorf("multiple '%s' files found in assets", file)
|
||||
selected := indexFiles.AsSlice()[0]
|
||||
for _, f := range indexFiles.AsSlice() {
|
||||
if len(f) < len(selected) {
|
||||
selected = f
|
||||
}
|
||||
}
|
||||
path, _ := filepath.Split(selected)
|
||||
return path, nil
|
||||
}
|
||||
|
||||
path, _ := filepath.Split(indexFiles.AsSlice()[0])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue