Skip to content

Commit 0d0dd6b

Browse files
author
Josh Newman
committed
fix(ls): fix new line bug for values
1 parent 0603802 commit 0d0dd6b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

cmd/ls.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,23 @@ func runLsCmd(cmd *cobra.Command, args []string) {
7474
formatDate(param.LastModifiedDate),
7575
}
7676

77+
val := *param.Value
78+
79+
// seems like the upgrade to v2 of the aws-sdk sends back a new line on values :shrug:
80+
if strings.HasSuffix(val, "\n") {
81+
val = strings.TrimSuffix(val, "\n")
82+
}
83+
7784
if displayValues {
78-
row = insertColumn(row, 1, *param.Value)
85+
row = insertColumn(row, 1, val)
7986
}
8087

8188
if plain {
8289
if displayValues {
8390
if toEnv {
84-
fmt.Printf("%s=%s\n", strings.ToUpper(strings.ReplaceAll(rest, "-", "_")), *param.Value)
91+
fmt.Printf("%s=%s\n", strings.ToUpper(strings.ReplaceAll(rest, "-", "_")), val)
8592
} else {
86-
fmt.Printf("%s: %s\n", rest, *param.Value)
93+
fmt.Printf("%s: %s\n", rest, val)
8794
}
8895
} else {
8996
fmt.Println(rest)

0 commit comments

Comments
 (0)