Better fix for presets on Windows (#1336)

This commit is contained in:
Evan Simkowitz 2024-11-21 12:58:03 -08:00 committed by GitHub
parent 697e8284c8
commit 7054b17eb3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -189,8 +189,8 @@ func readConfigHelper(fileName string, barr []byte, readErr error) (waveobj.Meta
func readConfigFileFS(fsys fs.FS, logPrefix string, fileName string) (waveobj.MetaMapType, []ConfigError) {
barr, readErr := fs.ReadFile(fsys, fileName)
if readErr != nil && strings.Contains(readErr.Error(), "invalid argument") {
// If we get an `invalid argument` error, we may be using the wrong path separator for the given FS interface. Try switching the separator.
if readErr != nil {
// If we get an error, we may be using the wrong path separator for the given FS interface. Try switching the separator.
barr, readErr = fs.ReadFile(fsys, filepath.ToSlash(fileName))
}
return readConfigHelper(logPrefix+fileName, barr, readErr)