@@ -29,10 +29,10 @@ import (
2929 "time"
3030
3131 "github.com/dustin/go-humanize"
32- "github.com/jonjohnsonjr/dagdotdev/pkg/forks/github.com/google/go-containerregistry/pkg/logs"
3332 "github.com/jonjohnsonjr/dagdotdev/internal/forks/elf"
3433 "github.com/jonjohnsonjr/dagdotdev/internal/forks/safefilepath"
3534 "github.com/jonjohnsonjr/dagdotdev/internal/xxd"
35+ "github.com/jonjohnsonjr/dagdotdev/pkg/forks/github.com/google/go-containerregistry/pkg/logs"
3636 "golang.org/x/exp/slices"
3737)
3838
@@ -481,6 +481,9 @@ func tarListAll(i int, dirs anyDirs, fi fs.FileInfo, u url.URL, uprefix, fprefix
481481 header , ok := fi .Sys ().(* tar.Header )
482482 if ! ok {
483483 name := fi .Name ()
484+ if fi .IsDir () {
485+ name += "/"
486+ }
484487 ts := "????-??-?? ??:??"
485488 ug := "?/?"
486489 mode := "d?????????"
@@ -496,6 +499,9 @@ func tarListAll(i int, dirs anyDirs, fi fs.FileInfo, u url.URL, uprefix, fprefix
496499 s := fmt .Sprintf ("%s %s <span title=%q>%*d</span> %s" , mode , ug , humanize .IBytes (uint64 (header .Size )), padding , header .Size , ts )
497500
498501 name := dirs .name (i )
502+ if dirs .isDir (i ) {
503+ name += "/"
504+ }
499505 if header .Linkname != "" {
500506 if header .Linkname == "." {
501507 u .Path = path .Dir (u .Path )
@@ -535,6 +541,9 @@ func tarList(i int, dirs anyDirs, showlayer bool, fi fs.FileInfo, u url.URL, upr
535541 header , ok := fi .Sys ().(* tar.Header )
536542 if ! ok {
537543 name := fi .Name ()
544+ if fi .IsDir () {
545+ name += "/"
546+ }
538547 ts := "????-??-?? ??:??"
539548 ug := "?/?"
540549 mode := "d?????????"
@@ -564,6 +573,9 @@ func tarList(i int, dirs anyDirs, showlayer bool, fi fs.FileInfo, u url.URL, upr
564573 s = prefix + " " + s
565574 }
566575 name := fi .Name ()
576+ if fi .IsDir () {
577+ name += "/"
578+ }
567579 if header .Linkname != "" {
568580 if header .Linkname == "." {
569581 u .Path = path .Dir (u .Path )
@@ -615,6 +627,9 @@ func tarListSize(i int, dirs anyDirs, showlayer bool, fi fs.FileInfo, u url.URL,
615627 header , ok := fi .Sys ().(* tar.Header )
616628 if ! ok {
617629 name := fi .Name ()
630+ if fi .IsDir () {
631+ name += "/"
632+ }
618633 ts := "????-??-?? ??:??"
619634 ug := "?/?"
620635 mode := "d?????????"
@@ -647,6 +662,9 @@ func tarListSize(i int, dirs anyDirs, showlayer bool, fi fs.FileInfo, u url.URL,
647662 s = fmt .Sprintf ("<small>%*s</small> " , ownerLength , owner ) + s
648663 }
649664 name := dirs .name (i )
665+ if dirs .isDir (i ) {
666+ name += "/"
667+ }
650668 if header .Linkname != "" {
651669 if header .Linkname == "." {
652670 u .Path = path .Dir (u .Path )
@@ -692,6 +710,9 @@ func TarList(fi fs.FileInfo, u url.URL, uprefix string) string {
692710 header , ok := fi .Sys ().(* tar.Header )
693711 if ! ok {
694712 name := fi .Name ()
713+ if fi .IsDir () {
714+ name += "/"
715+ }
695716 ts := "????-??-?? ??:??"
696717 ug := "?/?"
697718 mode := "d?????????"
@@ -706,6 +727,9 @@ func TarList(fi fs.FileInfo, u url.URL, uprefix string) string {
706727 padding := 18 - len (ug )
707728 s := fmt .Sprintf ("%s %s <span title=%q>%*d</span> %s" , mode , ug , humanize .IBytes (uint64 (header .Size )), padding , header .Size , ts )
708729 name := fi .Name ()
730+ if fi .IsDir () {
731+ name += "/"
732+ }
709733 if header .Linkname != "" {
710734 if header .Linkname == "." {
711735 u .Path = path .Dir (u .Path )
0 commit comments