This commit is contained in:
Daniel Hougaard
2024-04-22 16:02:16 +02:00
parent 34543ef127
commit e008fb26a2
3 changed files with 2 additions and 3 deletions
-1
View File
@@ -312,6 +312,5 @@ func execCmd(cmd *exec.Cmd) error {
waitStatus := cmd.ProcessState.Sys().(syscall.WaitStatus) waitStatus := cmd.ProcessState.Sys().(syscall.WaitStatus)
os.Exit(waitStatus.ExitStatus()) os.Exit(waitStatus.ExitStatus())
return nil return nil
} }
+1 -1
View File
@@ -116,7 +116,7 @@ var secretsCmd = &cobra.Command{
secrets = util.ExpandSecrets(secrets, authParams, "") secrets = util.ExpandSecrets(secrets, authParams, "")
} }
// convert secrets to the same order as the keys // Sort the secrets by key so we can create a consistent output
secrets = util.SortSecretsByKeys(secrets) secrets = util.SortSecretsByKeys(secrets)
visualize.PrintAllSecretDetails(secrets) visualize.PrintAllSecretDetails(secrets)
+1 -1
View File
@@ -53,8 +53,8 @@ func GetBase64DecodedSymmetricEncryptionDetails(key string, cipher string, IV st
}, nil }, nil
} }
// Helper function to sort the secrets by key so we can create a consistent output
func SortSecretsByKeys(secrets []models.SingleEnvironmentVariable) []models.SingleEnvironmentVariable { func SortSecretsByKeys(secrets []models.SingleEnvironmentVariable) []models.SingleEnvironmentVariable {
// sort secrets by key
for i := 0; i < len(secrets); i++ { for i := 0; i < len(secrets); i++ {
for j := i + 1; j < len(secrets); j++ { for j := i + 1; j < len(secrets); j++ {
if secrets[i].Key > secrets[j].Key { if secrets[i].Key > secrets[j].Key {