Don't generate trailing spaces

This commit is contained in:
Avi Dessauer 2020-05-08 23:14:26 -04:00
parent 07bd89709f
commit 62e4f18708
2 changed files with 19 additions and 13 deletions

View File

@ -50,7 +50,6 @@ cradle:
- path: "metametapost/src/Cli.hs" - path: "metametapost/src/Cli.hs"
component: "metametapost:exe:metametapost-optics" component: "metametapost:exe:metametapost-optics"
``` ```
## Features ## Features

View File

@ -18,7 +18,14 @@ hieYaml sOrC pkgs =
(sOrC <> ":\n" <> indent' pkgs) (sOrC <> ":\n" <> indent' pkgs)
indent' :: String -> String indent' :: String -> String
indent' = unlines . map (" " <>) . lines indent' =
unlines
. map
( \l -> case l of
"" -> ""
_ -> " " <> l
)
. lines
cabalComponent :: Name -> Component -> (FilePath, String) cabalComponent :: Name -> Component -> (FilePath, String)
cabalComponent n (Comp Lib "" p) = (T.unpack p, T.unpack $ "lib:" <> n) cabalComponent n (Comp Lib "" p) = (T.unpack p, T.unpack $ "lib:" <> n)