Skip to content

Commit

Permalink
fix: display correct region in message when no resources are found (#440
Browse files Browse the repository at this point in the history
)

Print the value of the region flag (if set) instead of the default region.
  • Loading branch information
Praveen005 authored Jul 11, 2024
1 parent 1b4aa90 commit 2dfbe17
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion utility/output_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,12 @@ func prettyprint(b []byte) ([]byte, error) {
func (ow *OutputWriter) FinishAndPrintOutput() {
ow.finishExistingLine()
if len(ow.Values) == 0 {
region := config.Current.Meta.DefaultRegion
var region string
if common.RegionSet != "" {
region = common.RegionSet
} else {
region = config.Current.Meta.DefaultRegion
}
fmt.Fprintf(os.Stderr, "No resources found in region %s. For a list of regions use the command 'civo region ls'\n", region)
} else {
switch common.OutputFormat {
Expand Down

0 comments on commit 2dfbe17

Please sign in to comment.