Skip to content

Commit

Permalink
adds more documentation on find command
Browse files Browse the repository at this point in the history
  • Loading branch information
theNerd247 committed May 6, 2020
1 parent 03adb1d commit 5af5f3c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Turtle/Prelude.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1725,6 +1725,15 @@ inplaceWith sed_ pattern' file = liftIO (runManaged (do
mv tmpfile file ))

-- | Search a directory recursively for all files matching the given `Pattern`
-- Note: The `Pattern` matches against the full path of a file as opposed to
-- just the base name as in GNU find. For example:
--
-- > find "foo.txt" "./bar"
--
-- will return only a single filepath: @./bar/foo.txt@. To search for a
-- filename in a similar manner to GNU find do something similar to:
--
-- > find (suffix $ "/" *> "foo.txt") "./bar"
find :: Pattern a -> FilePath -> Shell FilePath
find pattern' dir = do
path <- lsif isNotSymlink dir
Expand Down

0 comments on commit 5af5f3c

Please sign in to comment.