providers/os: Fix incorrect return value count

This commit is contained in:
Sasha Koshka 2025-07-07 07:49:23 -04:00
parent 2293780131
commit a377995a5b

View File

@ -148,12 +148,12 @@ func (this *state) funcWriteFile (name, content string) error {
func (this *state) countFiles(name string) (int, error) {
name, err := this.document.Rel(name)
if err != nil { return err }
if err != nil { return 0, err }
// genuinely can't believe this is the only way to do it, we have to
// read their names and everything, all that work just to know how many
// files there are, its slightly upsetting
files, err := os.ReadDir(name)
if err != nil { return err }
if err != nil { return 0, err }
return len(files), nil
}