mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2024-11-05 05:04:13 +01:00
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:
parent
2b9dc9f17c
commit
e07dd0d991
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user