mirror of
https://github.com/getsops/sops.git
synced 2026-02-05 12:45:21 +01:00
Sort sops parameters in dotenv file
This commit is contained in:
committed by
Andraz Bajt
parent
a0aec47c48
commit
e25c1d9c2d
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/getsops/sops/v3"
|
||||
@@ -98,7 +99,14 @@ func (store *Store) EmitEncryptedFile(in sops.Tree) ([]byte, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for key, value := range mdItems {
|
||||
var keys []string
|
||||
for k := range mdItems {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
sort.Strings(keys)
|
||||
|
||||
for _, key := range keys {
|
||||
var value = mdItems[key]
|
||||
if value == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user