Skip to content

Commit

Permalink
Merge pull request #232 from depot/fix/list-no-tty
Browse files Browse the repository at this point in the history
fix(list): output projects or builds as CSV when no tty
  • Loading branch information
goller authored Dec 12, 2023
2 parents ffd944b + cd1b377 commit 971eeaf
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 971eeaf

Please sign in to comment.