Skip to content

Commit

Permalink
fix(list): output projects or builds as CSV when no tty
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Goller <[email protected]>
  • Loading branch information
goller committed Dec 12, 2023
1 parent ffd944b commit cd1b377
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/cmd/list/builds.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ func NewCmdBuilds() *cobra.Command {
}

client := api.NewBuildClient()
if !helpers.IsTerminal() {
outputFormat = "csv"
}
if outputFormat != "" {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
Expand Down
3 changes: 3 additions & 0 deletions pkg/cmd/list/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ func NewCmdProjects() *cobra.Command {
)

projectClient := api.NewProjectsClient()
if !helpers.IsTerminal() {
outputFormat = "csv"
}
if outputFormat != "" {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
Expand Down

0 comments on commit cd1b377

Please sign in to comment.