cmd/app: omit hidden files

This avoids vim swap files breaking scripts.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-07-07 13:26:58 +09:00
parent 4a42657d88
commit 810b806a15
2 changed files with 19 additions and 23 deletions
+17
View File
@@ -4,6 +4,7 @@ import (
"bufio"
"fmt"
"io"
"os"
"strconv"
"strings"
@@ -335,3 +336,19 @@ func parse(
return &c, nil
}
// list prints names of non-hidden entries in pathname.
func list(pathname *check.Absolute, dir bool) error {
dents, err := os.ReadDir(pathname.String())
if err != nil {
return err
}
for _, dent := range dents {
name := dent.Name()
if (dent.IsDir() != dir) || (len(name) > 0 && name[0] == '.') {
continue
}
fmt.Println(dent.Name())
}
return nil
}