aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-03-23 21:36:39 -0700
committerChris Lu <chris.lu@gmail.com>2020-03-23 21:36:39 -0700
commitb51fa81f0e7cd7ab21f3683f356b0380f9dce75b (patch)
tree9eff41f5807f696461569079d61fed02c473c491
parente666aeece2778812a4a9d3fc4daaaac86fe4a412 (diff)
downloadseaweedfs-b51fa81f0e7cd7ab21f3683f356b0380f9dce75b.tar.xz
seaweedfs-b51fa81f0e7cd7ab21f3683f356b0380f9dce75b.zip
fix directory checking
-rw-r--r--weed/shell/commands.go6
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