Ensure "existingfile" doesn't choke on "-".
This commit is contained in:
@@ -555,13 +555,15 @@ func existingFileMapper(r *Registry) MapperFunc {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
path = ExpandPath(path)
|
if path != "-" {
|
||||||
stat, err := os.Stat(path)
|
path = ExpandPath(path)
|
||||||
if err != nil {
|
stat, err := os.Stat(path)
|
||||||
return err
|
if err != nil {
|
||||||
}
|
return err
|
||||||
if stat.IsDir() {
|
}
|
||||||
return errors.Errorf("%q exists but is a directory", path)
|
if stat.IsDir() {
|
||||||
|
return errors.Errorf("%q exists but is a directory", path)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
target.SetString(path)
|
target.SetString(path)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user