feat: truncate secret value if terminal is too small

This commit is contained in:
jon4hz
2023-03-10 21:19:56 +01:00
parent 14206de926
commit c900022697
5 changed files with 77 additions and 10 deletions

View File

@@ -3,12 +3,12 @@ package visualize
import "github.com/Infisical/infisical-merge/packages/models"
func PrintAllSecretDetails(secrets []models.SingleEnvironmentVariable) {
rows := [][]string{}
rows := [][3]string{}
for _, secret := range secrets {
rows = append(rows, []string{secret.Key, secret.Value, secret.Type})
rows = append(rows, [...]string{secret.Key, secret.Value, secret.Type})
}
headers := []string{"SECRET NAME", "SECRET VALUE", "SECRET TYPE"}
headers := [...]string{"SECRET NAME", "SECRET VALUE", "SECRET TYPE"}
Table(headers, rows)
}