Skip to content

Commit

Permalink
fix: Fix a small UNIX bug where the JSON output was getting managed b…
Browse files Browse the repository at this point in the history
…y errors on stdout (#280)
  • Loading branch information
prologic authored Feb 3, 2025
1 parent 0e465c5 commit cbd2f10
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dist/

# Code generation binaries
bin/
/sloctl

# Dependency directories (remove the comment below to include it)
# vendor/
Expand All @@ -26,3 +27,9 @@ bin/
node_modules/
yarn.lock
yarn-error.log

# Other editor or OS-specific files we don't want to commit by accident!
*~
*.bak
**/.envrc
**/.DS_Store
7 changes: 3 additions & 4 deletions internal/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@ func (g *GetCmd) newGetAlertCommand(cmd *cobra.Command) *cobra.Command {
return err
}
if len(objects) == 0 {
fmt.Printf("No resources found in '%s' project.\n", g.client.Config.Project)
return nil
fmt.Fprintf(os.Stderr, "No resources found in '%s' project.\n", g.client.Config.Project)
}
if err = g.printObjects(objects); err != nil {
return err
Expand Down Expand Up @@ -395,9 +394,9 @@ func (g *GetCmd) getObjects(ctx context.Context, args []string, kind manifest.Ki
if len(objects) == 0 {
switch kind {
case manifest.KindProject, manifest.KindUserGroup, manifest.KindBudgetAdjustment, manifest.KindReport:
fmt.Printf("No resources found.\n")
fmt.Fprintf(os.Stderr, "No resources found.\n")
default:
fmt.Printf("No resources found in '%s' project.\n", g.client.Config.Project)
fmt.Fprintf(os.Stderr, "No resources found in '%s' project.\n", g.client.Config.Project)
}
return nil, nil
}
Expand Down

0 comments on commit cbd2f10

Please sign in to comment.