mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01:00
Better fix for presets on Windows (#1336)
This commit is contained in:
parent
697e8284c8
commit
7054b17eb3
@ -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) {
|
func readConfigFileFS(fsys fs.FS, logPrefix string, fileName string) (waveobj.MetaMapType, []ConfigError) {
|
||||||
barr, readErr := fs.ReadFile(fsys, fileName)
|
barr, readErr := fs.ReadFile(fsys, fileName)
|
||||||
if readErr != nil && strings.Contains(readErr.Error(), "invalid argument") {
|
if readErr != nil {
|
||||||
// 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 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))
|
barr, readErr = fs.ReadFile(fsys, filepath.ToSlash(fileName))
|
||||||
}
|
}
|
||||||
return readConfigHelper(logPrefix+fileName, barr, readErr)
|
return readConfigHelper(logPrefix+fileName, barr, readErr)
|
||||||
|
Loading…
Reference in New Issue
Block a user