Don't check if path is a directory (#220)

We only run a stat on the path to check there is no error
This commit is contained in:
Romain de Laage
2022-08-22 17:28:38 +02:00
committed by GitHub
parent 2b9dc9f17c
commit e07dd0d991

View File

@@ -74,12 +74,8 @@ func (l Location) validate() error {
if from, err := GetPathRelativeToConfig(path); err != nil {
return err
} else {
if stat, err := os.Stat(from); err != nil {
if _, err := os.Stat(from); err != nil {
return err
} else {
if !stat.IsDir() {
return fmt.Errorf("\"%s\" is not valid directory for location \"%s\"", from, l.name)
}
}
}
}