Skip to content

Commit

Permalink
🐛 avoid printing home-path for root (#1842)
Browse files Browse the repository at this point in the history
Root just uses the system path, so trying to print a home path that is
an empty string is confusing and wrong.

Before:


![image](https://github.com/mondoohq/cnquery/assets/1307529/1e4333be-cc6e-43fb-9608-ea458bb85f6a)


After:


![image](https://github.com/mondoohq/cnquery/assets/1307529/9247a2a0-bd8b-48a1-a368-2ed1d82b77c7)

Signed-off-by: Dominik Richter <[email protected]>
  • Loading branch information
arlimus authored Sep 22, 2023
1 parent 52fdbe9 commit 3fae907
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/cnquery/cmd/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func printProviders(p []*providers.Provider) {

func printProviderPath(path string, list []*providers.Provider, printEmpty bool) {
if list == nil {
if printEmpty {
if printEmpty && path != "" {
fmt.Println("")
log.Info().Msg(path + " has no providers")
}
Expand Down

0 comments on commit 3fae907

Please sign in to comment.