diff --git a/cmd/files.go b/cmd/files.go index ff646ce..360c8fa 100644 --- a/cmd/files.go +++ b/cmd/files.go @@ -171,8 +171,8 @@ func appendPaths(path string, files *files, filters *filters, stats *scanStats, return nil } -func newFile(paths []string, filters *filters, sortOrder string, regexes *regexes, index *fileCache, formats *types.Types) (string, error) { - path, err := pickFile(paths, filters, sortOrder, index, formats) +func newFile(paths []string, filters *filters, sortOrder string, regexes *regexes, cache *fileCache, formats *types.Types) (string, error) { + path, err := pickFile(paths, filters, sortOrder, cache, formats) if err != nil { return "", nil } @@ -505,24 +505,6 @@ func fileList(paths []string, filters *filters, sort string, cache *fileCache, f return fileList, false } -func cleanFilename(filename string) string { - return filename[:len(filename)-(len(filepath.Ext(filename))+3)] -} - -func prepareDirectory(directory []string) []string { - _, first := filepath.Split(directory[0]) - first = cleanFilename(first) - - _, last := filepath.Split(directory[len(directory)-1]) - last = cleanFilename(last) - - if first == last { - return []string{directory[0]} - } else { - return directory - } -} - func prepareDirectories(files *files, sort string) []string { directories := []string{} @@ -534,14 +516,8 @@ func prepareDirectories(files *files, sort string) []string { i++ } - if sort == "asc" || sort == "desc" { - for i := 0; i < len(keys); i++ { - directories = append(directories, prepareDirectory(files.list[keys[i]])...) - } - } else { - for i := 0; i < len(keys); i++ { - directories = append(directories, files.list[keys[i]]...) - } + for i := 0; i < len(keys); i++ { + directories = append(directories, files.list[keys[i]]...) } return directories @@ -618,7 +594,7 @@ func normalizePath(path string) (string, error) { return absolutePath, nil } -func normalizePaths(args []string, formats *types.Types) ([]string, error) { +func validatePaths(args []string, formats *types.Types) ([]string, error) { var paths []string var pathList strings.Builder diff --git a/cmd/root.go b/cmd/root.go index 8ad7a43..42ea417 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -12,7 +12,7 @@ import ( ) const ( - ReleaseVersion string = "0.79.0" + ReleaseVersion string = "0.80.0" ) var ( diff --git a/cmd/web.go b/cmd/web.go index dd6beed..76f4197 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -332,7 +332,7 @@ func ServePage(args []string) error { formats.Add(images.New()) } - paths, err := normalizePaths(args, formats) + paths, err := validatePaths(args, formats) if err != nil { return err } diff --git a/default.pgo b/default.pgo index 528da57..dc64f9a 100644 Binary files a/default.pgo and b/default.pgo differ