Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Cleanup

Daniel Hougaarde008fb26a27b
diff --git a/cli/packages/cmd/run.go b/cli/packages/cmd/run.go
index f137a146d5..04fe2588b6 100644
--- a/cli/packages/cmd/run.go
+++ b/cli/packages/cmd/run.go
@@ -312,6 +312,5 @@ func execCmd(cmd *exec.Cmd) error {
waitStatus := cmd.ProcessState.Sys().(syscall.WaitStatus)
os.Exit(waitStatus.ExitStatus())
-
return nil
}
diff --git a/cli/packages/cmd/secrets.go b/cli/packages/cmd/secrets.go
index 80b1d02923..f2f6940751 100644
--- a/cli/packages/cmd/secrets.go
+++ b/cli/packages/cmd/secrets.go
@@ -116,7 +116,7 @@ var secretsCmd = &cobra.Command{
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)
visualize.PrintAllSecretDetails(secrets)
diff --git a/cli/packages/util/helper.go b/cli/packages/util/helper.go
index 33e22e0401..5ffe5c9f1b 100644
--- a/cli/packages/util/helper.go
+++ b/cli/packages/util/helper.go
@@ -53,8 +53,8 @@ func GetBase64DecodedSymmetricEncryptionDetails(key string, cipher string, IV st
}, nil
}
+// Helper function to sort the secrets by key so we can create a consistent output
func SortSecretsByKeys(secrets []models.SingleEnvironmentVariable) []models.SingleEnvironmentVariable {
- // sort secrets by key
for i := 0; i < len(secrets); i++ {
for j := i + 1; j < len(secrets); j++ {
if secrets[i].Key > secrets[j].Key {