|
|
@ -49,14 +49,16 @@ func (l Location) validate(c *Config) error {
|
|
|
|
if l.From == "" {
|
|
|
|
if l.From == "" {
|
|
|
|
return fmt.Errorf(`Location "%s" is missing "from" key`, l.name)
|
|
|
|
return fmt.Errorf(`Location "%s" is missing "from" key`, l.name)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if from, err := GetPathRelativeToConfig(l.From); err != nil {
|
|
|
|
if l.getType() == TypeLocal {
|
|
|
|
return err
|
|
|
|
if from, err := GetPathRelativeToConfig(l.From); err != nil {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if stat, err := os.Stat(from); err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if !stat.IsDir() {
|
|
|
|
if stat, err := os.Stat(from); err != nil {
|
|
|
|
return fmt.Errorf("\"%s\" is not valid directory for location \"%s\"", from, l.name)
|
|
|
|
return err
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if !stat.IsDir() {
|
|
|
|
|
|
|
|
return fmt.Errorf("\"%s\" is not valid directory for location \"%s\"", from, l.name)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|