Skip to content

Commit 31e4a15

Browse files
committed
fix panic if url isn't generated
1 parent 9691200 commit 31e4a15

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@
1616

1717
# ide
1818
.idea/
19+
20+
# goreleaser
21+
dist/

cmd/ploy/get/cli.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,16 @@ func Command() *cobra.Command {
6868
return fmt.Errorf("error selecting stack")
6969
}
7070
out, err := stack.Outputs(ctx)
71+
72+
var url string
73+
if out["address"].Value == nil {
74+
url = ""
75+
} else {
76+
url = fmt.Sprintf("http://%s", out["address"].Value.(string))
77+
}
7178

7279
// add all the values to the output tables
73-
table.Append([]string{values.Name, values.LastUpdate, values.URL, fmt.Sprintf("http://%s", out["address"].Value.(string))})
80+
table.Append([]string{values.Name, values.LastUpdate, values.URL, url })
7481
}
7582

7683
// Render the table to stdout

0 commit comments

Comments
 (0)