In case there are multiple dots
This commit is contained in:
parent
397b8764fd
commit
0a909da52f
|
@ -50,7 +50,7 @@ parseArgs (Args t dir h v r c b) = do
|
||||||
if b then do
|
if b then do
|
||||||
mapM_ (mkIndex r dir) . filter (isSuffixOf ".gmi") =<< getDirectoryContents dir
|
mapM_ (mkIndex r dir) . filter (isSuffixOf ".gmi") =<< getDirectoryContents dir
|
||||||
putStr "\n"
|
putStr "\n"
|
||||||
putStrLn "=> ../ "
|
putStrLn "=> .. "
|
||||||
else mapM_ (mkIndex r dir) . filter (isSuffixOf ".gmi") =<< getDirectoryContents dir
|
else mapM_ (mkIndex r dir) . filter (isSuffixOf ".gmi") =<< getDirectoryContents dir
|
||||||
|
|
||||||
mkIndex :: Bool -> FilePath -> FilePath -> IO ()
|
mkIndex :: Bool -> FilePath -> FilePath -> IO ()
|
||||||
|
@ -68,7 +68,7 @@ mkIndex True d l =
|
||||||
cleanString = filter (/= "") . map (dropWhile (== '#'))
|
cleanString = filter (/= "") . map (dropWhile (== '#'))
|
||||||
-- in case the last character is a dot, remove it
|
-- in case the last character is a dot, remove it
|
||||||
appendDots name
|
appendDots name
|
||||||
| last name == '.' = (++ "...") . init $ name
|
| last name == '.' = (++ "...") . reverse . dropWhile (=='.') . reverse $ name
|
||||||
| otherwise = name
|
| otherwise = name
|
||||||
in do
|
in do
|
||||||
line <- trim . words . head . lines <$> readFile path
|
line <- trim . words . head . lines <$> readFile path
|
||||||
|
|
Loading…
Reference in a new issue