File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -17,18 +17,20 @@ main = do
17
17
pwd <- getCurrentDirectory
18
18
files <- listDirectory pwd
19
19
cfs <- cabalFiles pwd
20
- let sOrC =
21
- if | any ((" dist-newstyle" == ) . takeFileName) files -> cabalHieYaml
22
- | any ((" .stack-work" == ) . takeFileName) files -> stackHieYaml
23
- | any ((" stack.yaml" == ) . takeFileName) files -> stackHieYaml
24
- | otherwise -> cabalHieYaml
20
+ let cabal = (cabalHieYaml, " Cabal " )
21
+ stack = (stackHieYaml, " Stack " )
22
+ sOrC =
23
+ if | any ((" dist-newstyle" == ) . takeFileName) files -> cabal
24
+ | any ((" .stack-work" == ) . takeFileName) files -> stack
25
+ | any ((" stack.yaml" == ) . takeFileName) files -> stack
26
+ | otherwise -> cabal
25
27
gen f = do
26
28
f' <- T. readFile f
27
29
case parseOnly parsePackage f' of
28
30
Right r -> do
29
31
let hiePath = fst (splitFileName f) </> " hie.yaml"
30
- T. writeFile hiePath $ sOrC r
31
- pure (" wrote " <> hiePath)
32
+ T. writeFile hiePath $ fst sOrC r
33
+ pure (" wrote " <> snd sOrC <> hiePath)
32
34
_ -> pure $ " Could not parse " <> f
33
35
when (null cfs) $ error $
34
36
" No .cabal files found under"
You can’t perform that action at this time.
0 commit comments