diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-03-23 21:36:39 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-03-23 21:36:39 -0700 |
| commit | b51fa81f0e7cd7ab21f3683f356b0380f9dce75b (patch) | |
| tree | 9eff41f5807f696461569079d61fed02c473c491 | |
| parent | e666aeece2778812a4a9d3fc4daaaac86fe4a412 (diff) | |
| download | seaweedfs-b51fa81f0e7cd7ab21f3683f356b0380f9dce75b.tar.xz seaweedfs-b51fa81f0e7cd7ab21f3683f356b0380f9dce75b.zip | |
fix directory checking
| -rw-r--r-- | weed/shell/commands.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/weed/shell/commands.go b/weed/shell/commands.go index 7e240de5f..6e40380e0 100644 --- a/weed/shell/commands.go +++ b/weed/shell/commands.go @@ -69,7 +69,11 @@ func (ce *CommandEnv) checkDirectory(path string) error { dir, name := util.FullPath(path).DirAndName() - _, err := filer_pb.Exists(ce, dir, name, true) + exists, err := filer_pb.Exists(ce, dir, name, true) + + if !exists { + return fmt.Errorf("%s is not a directory", path) + } return err |
