forked from toolshed/abra
feat(secrets): Sort list output
This is usefull for scripting.
This commit is contained in:
@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@ -435,6 +436,10 @@ var AppSecretLsCommand = &cobra.Command{
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// Sort secrets to ensure reproducible output
|
||||
sort.Slice(secStats, func(i, j int) bool {
|
||||
return secStats[i].LocalName < secStats[j].LocalName
|
||||
})
|
||||
var rows [][]string
|
||||
for _, secStat := range secStats {
|
||||
row := []string{
|
||||
|
@ -357,6 +357,12 @@ teardown(){
|
||||
| jq -r ".[] | select(.name==\"test_pass_two\") | .version"'
|
||||
assert_success
|
||||
assert_output --partial 'v1'
|
||||
|
||||
# Can always expect the secret at this position
|
||||
run bash -c '$ABRA app secret ls "$TEST_APP_DOMAIN" --machine \
|
||||
| jq -r ".[1] | .name"'
|
||||
assert_success
|
||||
assert_output --partial 'test_pass_two'
|
||||
}
|
||||
|
||||
@test "ls: bail if unstaged changes and no --chaos" {
|
||||
|
Reference in New Issue
Block a user