diff --git a/file.go b/file.go index 633ac3779c61814dfe6aafce3745e0a53cf3deb4..297efb2d84ca833750d81283c9cc5e6467fdf67e 100644 --- a/file.go +++ b/file.go @@ -4,11 +4,12 @@ package configuration import ( - "golang.org/x/exp/slices" "io/fs" "os" "path" "path/filepath" + + "golang.org/x/exp/slices" ) type files struct { @@ -137,10 +138,12 @@ func (s *Settings[C]) sanitizeDirectories() { visited[d] = true } - if _, err := os.Stat(d); os.IsNotExist(err) { - s.errors = append(s.errors, newPathDoesNotExistError(d)) - } + } + // check last entry + d := s.files.directories[len(s.files.directories)-1] + if _, err := os.Stat(d); os.IsNotExist(err) { + s.errors = append(s.errors, newPathDoesNotExistError(d)) } }