Permalink
Browse files

takeFileName in NNUtils.

  • Loading branch information...
1 parent a02105e commit 04802462cc0bd4b5e238c9320e391311ef9393d0 @bjornbm committed Jan 3, 2012
Showing with 5 additions and 5 deletions.
  1. +3 −3 NNUtil.hs
  2. +2 −2 nn.hs
View
@@ -14,15 +14,15 @@ import System.Process
-- names can contain @\n@ and would get split by @lines@.
mdfind args = do
dir <- getCurrentDirectory
- endBy "\0" <$> readProcess "mdfind" (stdArgs dir ++ args) ""
+ map takeFileName . endBy "\0" <$> readProcess "mdfind" (stdArgs dir ++ args) ""
where
stdArgs dir = [ "-onlyin", dir
, "-0"
]
-- | List all files in the directory except for hidden files.
-mdlist = getDirectoryContents =<< getCurrentDirectory
--- mdlist = filter ((/='.') . head) <$> getDirectoryContents "."
+mdlist = map takeFileName <$> (getDirectoryContents =<< getCurrentDirectory)
+
-- Regex patterns.
obsP = "^\\+?"
View
4 nn.hs
@@ -73,7 +73,7 @@ check (Check True False) = do
$ filter (/= ".")
$ filter (/= "..")
$ filter (not . (=~ filePattern'))
- $ fmap takeFileName files
+ $ files
-- List files with bad references.
check (Check False True) = do
@@ -101,4 +101,4 @@ getFiles [] = do
getFiles terms = do
processFiles <$> mdfind terms
-processFiles = sort . filter (=~ filePattern0) . fmap takeFileName
+processFiles = sort . filter (=~ filePattern0)

0 comments on commit 0480246

Please sign in to comment.