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

We only run a stat on the path to check there is no error
pull/223/head
Romain de Laage 2 years ago committed by GitHub
parent 2b9dc9f17c
commit e07dd0d991
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save