mirror of https://github.com/databricks/cli.git
address comments 2
This commit is contained in:
parent
b048c8675d
commit
265e517126
11
cmd/fs/ls.go
11
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}}
|
||||
`))
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue