Platform: Consolidate regular file resolution

Reuse ResolveRegularFile for Lua loading/signing, local config, and assets.
Only evaluate file symlinks when needed, tolerating junction-related
resolution failures on a best-effort basis.
This commit is contained in:
Meo597
2026-10-25 23:52:22 +08:00
parent 1b1647cd9d
commit 20d107a28a
4 changed files with 41 additions and 47 deletions
+1 -9
View File
@@ -61,15 +61,7 @@ func getAssetFileLocation(file string) (string, os.FileInfo, error) {
if err != nil {
return "", nil, err
}
path := platform.GetAssetLocation(local)
info, err := os.Stat(path)
if err != nil {
return "", nil, err
}
if !info.Mode().IsRegular() {
return "", nil, errors.New("asset is not a regular file")
}
return path, info, nil
return platform.ResolveRegularFile(platform.GetAssetLocation(local))
}
func ReadCert(file string) ([]byte, error) {