fixed inefficient file report bug
This commit is contained in:
parent
3ea8c0ab4a
commit
fad2354e89
@ -5,9 +5,9 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/wagoodman/dive/image"
|
"github.com/wagoodman/dive/image"
|
||||||
"github.com/wagoodman/dive/ui"
|
"github.com/wagoodman/dive/ui"
|
||||||
|
"github.com/wagoodman/dive/utils"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"github.com/wagoodman/dive/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// buildCmd represents the build command
|
// buildCmd represents the build command
|
||||||
|
10
cmd/root.go
10
cmd/root.go
@ -2,13 +2,13 @@ package cmd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/k0kubun/go-ansi"
|
||||||
"github.com/mitchellh/go-homedir"
|
"github.com/mitchellh/go-homedir"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"os"
|
|
||||||
"github.com/tebeka/atexit"
|
"github.com/tebeka/atexit"
|
||||||
"github.com/k0kubun/go-ansi"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
var cfgFile string
|
var cfgFile string
|
||||||
@ -17,10 +17,10 @@ var cfgFile string
|
|||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
Use: "dive [IMAGE]",
|
Use: "dive [IMAGE]",
|
||||||
Short: "Docker Image Visualizer & Explorer",
|
Short: "Docker Image Visualizer & Explorer",
|
||||||
Long: `This tool provides a way to discover and explore the contents of a docker image. Additionally the tool estimates
|
Long: `This tool provides a way to discover and explore the contents of a docker image. Additionally the tool estimates
|
||||||
the amount of wasted space and identifies the offending files from the image.`,
|
the amount of wasted space and identifies the offending files from the image.`,
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
Run: analyze,
|
Run: analyze,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute adds all child commands to the root command and sets flags appropriately.
|
// Execute adds all child commands to the root command and sets flags appropriately.
|
||||||
|
@ -2,7 +2,6 @@ package ui
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/dustin/go-humanize"
|
"github.com/dustin/go-humanize"
|
||||||
"github.com/jroimartin/gocui"
|
"github.com/jroimartin/gocui"
|
||||||
"github.com/lunixbochs/vtclean"
|
"github.com/lunixbochs/vtclean"
|
||||||
@ -97,7 +96,7 @@ func (view *DetailsView) Render() error {
|
|||||||
template := "%5s %12s %-s\n"
|
template := "%5s %12s %-s\n"
|
||||||
var trueInefficiencies int
|
var trueInefficiencies int
|
||||||
inefficiencyReport := fmt.Sprintf(Formatting.Header(template), "Count", "Total Space", "Path")
|
inefficiencyReport := fmt.Sprintf(Formatting.Header(template), "Count", "Total Space", "Path")
|
||||||
for idx := len(view.inefficiencies) - 1; idx > 0; idx-- {
|
for idx := len(view.inefficiencies) - 1; idx >= 0; idx-- {
|
||||||
data := view.inefficiencies[idx]
|
data := view.inefficiencies[idx]
|
||||||
if data.CumulativeSize == 0 {
|
if data.CumulativeSize == 0 {
|
||||||
continue
|
continue
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os/exec"
|
|
||||||
"os"
|
"os"
|
||||||
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -30,4 +30,3 @@ func cleanArgs(s []string) []string {
|
|||||||
}
|
}
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user