Skip to content

Commit 7889322

Browse files
authored
fix: sys.find: stop ignoring directories (#134)
Signed-off-by: Grant Linville <[email protected]>
1 parent fe3c4d7 commit 7889322

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pkg/builtin/builtin.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,14 @@ func SysFind(ctx context.Context, env []string, input string) (string, error) {
203203
if err != nil {
204204
return err
205205
}
206-
if d.IsDir() {
207-
return nil
208-
}
209206
if ok, err := filepath.Match(params.Pattern, d.Name()); err != nil {
210207
return err
211208
} else if ok {
212-
result = append(result, filepath.Join(params.Directory, pathname))
209+
path := filepath.Join(params.Directory, pathname)
210+
if d.IsDir() {
211+
path += "/"
212+
}
213+
result = append(result, path)
213214
}
214215
return nil
215216
})

0 commit comments

Comments
 (0)