Path parsing
This commit is contained in:
parent
e83fd886d0
commit
137b150cc3
10
app/Main.hs
10
app/Main.hs
|
@ -62,12 +62,12 @@ parseArgs (Args t dir h v r c) = do
|
||||||
if not (null h)
|
if not (null h)
|
||||||
then putStr $ "\n\n" ++ h ++ "\n\n"
|
then putStr $ "\n\n" ++ h ++ "\n\n"
|
||||||
else putStr "\n"
|
else putStr "\n"
|
||||||
mapM_ (mkIndex r) . filter (isSuffixOf ".gmi") =<< getDirectoryContents dir
|
mapM_ (mkIndex r dir) . filter (isSuffixOf ".gmi") =<< getDirectoryContents dir
|
||||||
|
|
||||||
mkIndex :: Bool -> FilePath -> IO ()
|
mkIndex :: Bool -> FilePath -> FilePath -> IO ()
|
||||||
mkIndex True l = do
|
mkIndex True d l = do
|
||||||
line <- readFile l
|
line <- readFile $ d++"/"++l
|
||||||
putStrLn $ "=> " ++ l ++ " " ++ (head . lines $ line)
|
putStrLn $ "=> " ++ l ++ " " ++ (head . lines $ line)
|
||||||
mkIndex False l = putStrLn $ "=> " ++ l
|
mkIndex False _ l = putStrLn $ "=> " ++ l
|
||||||
|
|
||||||
--compose = (++) <$> ("=> " ++) <*> (show . length) <*> (head . lines =<< readFile)
|
--compose = (++) <$> ("=> " ++) <*> (show . length) <*> (head . lines =<< readFile)
|
||||||
|
|
Loading…
Reference in a new issue