From 810b806a15f0964dec97357e49a17002ecdf65f1 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 7 Jul 2026 13:26:58 +0900 Subject: cmd/app: omit hidden files This avoids vim swap files breaking scripts. Signed-off-by: Ophestra --- cmd/app/app.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'cmd/app/app.go') diff --git a/cmd/app/app.go b/cmd/app/app.go index 4e4f314d..9679413f 100644 --- a/cmd/app/app.go +++ b/cmd/app/app.go @@ -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 +} -- cgit v1.3.1