Fix an output bug in get-context
This fixes an issue where `airshipctl config get-context` would provide no output when there were no contexts in the configuration. Change-Id: I8eaafff8ecee7878f80d22867b0420feba1bf376
This commit is contained in:
parent
0528b76b9c
commit
73f9eb383b
@ -95,8 +95,8 @@ func getContexts(out io.Writer, airconfig *config.Config) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if contexts == nil {
|
||||
fmt.Fprint(out, "No Contexts found in the configuration.\n")
|
||||
if len(contexts) == 0 {
|
||||
fmt.Fprintln(out, "No Contexts found in the configuration.")
|
||||
}
|
||||
for _, context := range contexts {
|
||||
fmt.Fprintf(out, "%s", context.PrettyString())
|
||||
|
@ -0,0 +1 @@
|
||||
No Contexts found in the configuration.
|
Loading…
Reference in New Issue
Block a user