From b51fa81f0e7cd7ab21f3683f356b0380f9dce75b Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 23 Mar 2020 21:36:39 -0700 Subject: [PATCH] fix directory checking --- weed/shell/commands.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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