Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a small UNIX bug where the JSON output was getting managed by errors on stdout #280

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading