globs: ignore hidden paths.

locals-and-roots
John Benediktsson 2016-03-28 08:01:28 -07:00
parent 367c565ba1
commit 676168cabc
1 changed files with 5 additions and 2 deletions

View File

@ -58,6 +58,9 @@ Main = Concatenation End
DEFER: glob-directory% DEFER: glob-directory%
: glob-entries ( path -- entries )
directory-entries [ name>> "." head? ] reject ;
: ?glob-directory% ( root remaining entry -- ) : ?glob-directory% ( root remaining entry -- )
directory? [ directory? [
glob-directory% glob-directory%
@ -69,7 +72,7 @@ DEFER: glob-directory%
globs ?second :> next-glob globs ?second :> next-glob
next-glob dup pair? [ second ] [ drop f ] if :> next-glob-regexp next-glob dup pair? [ second ] [ drop f ] if :> next-glob-regexp
root directory-entries [| entry | root glob-entries [| entry |
root entry name>> append-path root entry name>> append-path
{ {
{ [ next-glob not ] [ dup , ] } { [ next-glob not ] [ dup , ] }
@ -106,7 +109,7 @@ DEFER: glob-directory%
:: glob-pattern% ( root globs -- ) :: glob-pattern% ( root globs -- )
globs unclip second :> ( remaining glob ) globs unclip second :> ( remaining glob )
root directory-entries [| entry | root glob-entries [| entry |
entry name>> >case-fold glob matches? [ entry name>> >case-fold glob matches? [
root entry name>> append-path root entry name>> append-path
remaining entry ?glob-directory% remaining entry ?glob-directory%