From 6bab20d862cd2960dd4272cb7d6aa6abf8d6f097 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 24 Aug 2021 02:38:32 -0700 Subject: [PATCH] cat entry content --- weed/command/filer_cat.go | 5 +++++ weed/shell/command_fs_cat.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/weed/command/filer_cat.go b/weed/command/filer_cat.go index a46098b04..09f5e97fe 100644 --- a/weed/command/filer_cat.go +++ b/weed/command/filer_cat.go @@ -108,6 +108,11 @@ func runFilerCat(cmd *Command, args []string) bool { return err } + if len(respLookupEntry.Entry.Content) > 0 { + _, err = writer.Write(respLookupEntry.Entry.Content) + return err + } + filerCat.filerClient = client return filer.StreamContent(&filerCat, writer, respLookupEntry.Entry.Chunks, 0, math.MaxInt64) diff --git a/weed/shell/command_fs_cat.go b/weed/shell/command_fs_cat.go index 3c5e13663..a5731240d 100644 --- a/weed/shell/command_fs_cat.go +++ b/weed/shell/command_fs_cat.go @@ -52,6 +52,11 @@ func (c *commandFsCat) Do(args []string, commandEnv *CommandEnv, writer io.Write return err } + if len(respLookupEntry.Entry.Content) > 0 { + _, err = writer.Write(respLookupEntry.Entry.Content) + return err + } + return filer.StreamContent(commandEnv.MasterClient, writer, respLookupEntry.Entry.Chunks, 0, math.MaxInt64) })