From 4146421e604c8255a8eddc500066ed003da28600 Mon Sep 17 00:00:00 2001 From: lightsnowball Date: Thu, 21 Apr 2022 16:28:57 +0000 Subject: [PATCH] Fix error on Layer section and reduce information on one line per step. Instead of printing out multiple lines for some steps in Layer section, now its only printing one line while other informations can be found in Layer details. This change also provides fix for index out of bounds error when user scrolls through steps in Layer section and there exists at least one step with multi-line commands. --- dive/image/layer.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dive/image/layer.go b/dive/image/layer.go index 550eba1..ac96363 100644 --- a/dive/image/layer.go +++ b/dive/image/layer.go @@ -2,6 +2,8 @@ package image import ( "fmt" + "strings" + "github.com/dustin/go-humanize" "github.com/wagoodman/dive/dive/filetree" ) @@ -39,5 +41,5 @@ func (l *Layer) String() string { } return fmt.Sprintf(LayerFormat, humanize.Bytes(l.Size), - l.Command) + strings.Split(l.Command, "\n")[0]) }