diff --git a/cmd/fs/ls.go b/cmd/fs/ls.go index 7049db049..2e1e4f61f 100644 --- a/cmd/fs/ls.go +++ b/cmd/fs/ls.go @@ -39,12 +39,6 @@ var lsCmd = &cobra.Command{ Long: `Lists files`, Args: cobra.ExactArgs(1), PreRunE: root.MustWorkspaceClient, - Annotations: map[string]string{ - "template": cmdio.Heredoc(` - {{range .}}{{.Name}} - {{end}} - `), - }, RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() @@ -84,7 +78,10 @@ var lsCmd = &cobra.Command{ {{end}} `)) } - return cmdio.Render(ctx, jsonDirEntries) + return cmdio.RenderWithTemplate(ctx, jsonDirEntries, cmdio.Heredoc(` + {{range .}}{{.Name}} + {{end}} + `)) }, } diff --git a/libs/cmdio/render.go b/libs/cmdio/render.go index 063d7cbcb..2e42c32c2 100644 --- a/libs/cmdio/render.go +++ b/libs/cmdio/render.go @@ -88,7 +88,7 @@ func renderTemplate(w io.Writer, tmpl string, v any) error { return string(b), nil }, "pretty_date": func(t time.Time) string { - return t.UTC().Format("2006-01-02T15:04:05Z") + return t.Format("2006-01-02T15:04:05Z") }, }).Parse(tmpl) if err != nil {