This commit is contained in:
Pim van Pelt
2025-12-02 23:50:07 +01:00
parent c53fa96349
commit f8d9841a68
3 changed files with 36 additions and 36 deletions

View File

@@ -158,28 +158,28 @@ var ExtensionTypes = map[string]string{
} }
type Options struct { type Options struct {
TopDir string TopDir string
Filter string Filter string
OutputFile string OutputFile string
DirAppend bool DirAppend bool
Recursive bool Recursive bool
IncludeHidden bool IncludeHidden bool
ExcludeRegex *regexp.Regexp ExcludeRegex *regexp.Regexp
Verbose bool Verbose bool
} }
type FileEntry struct { type FileEntry struct {
Name string Name string
Path string Path string
IsDir bool IsDir bool
IsSymlink bool IsSymlink bool
Size int64 Size int64
ModTime time.Time ModTime time.Time
IconType string IconType string
CSSClass string CSSClass string
SizePretty string SizePretty string
ModTimeISO string ModTimeISO string
ModTimeHuman string ModTimeHuman string
} }
func ProcessDir(topDir string, opts *Options) error { func ProcessDir(topDir string, opts *Options) error {
@@ -215,14 +215,14 @@ func ProcessDir(topDir string, opts *Options) error {
}) })
templateData := struct { templateData := struct {
DirName string DirName string
Entries []FileEntry Entries []FileEntry
DirAppend bool DirAppend bool
OutputFile string OutputFile string
}{ }{
DirName: dirName, DirName: dirName,
Entries: entries, Entries: entries,
DirAppend: opts.DirAppend, DirAppend: opts.DirAppend,
OutputFile: opts.OutputFile, OutputFile: opts.OutputFile,
} }
@@ -282,9 +282,9 @@ func ReadDirEntries(dirPath string, opts *Options) ([]FileEntry, error) {
} }
entry := FileEntry{ entry := FileEntry{
Name: fileName, Name: fileName,
Path: fileName, Path: fileName,
IsDir: file.IsDir(), IsDir: file.IsDir(),
ModTime: info.ModTime(), ModTime: info.ModTime(),
} }