default to cabal if stack.yaml not found

This commit is contained in:
Avi Dessauer 2020-04-30 21:22:45 -04:00
parent a1fa2b9a17
commit 53996020b6

View File

@ -18,7 +18,8 @@ main = do
sOrC =
if | any ((".stack-work" ==) . takeFileName) files -> stackHieYaml
| any (("dist-newstyle" ==) . takeFileName) files -> cabalHieYaml
| otherwise -> stackHieYaml
| any (("stack.yaml" ==) . takeFileName) files -> stackHieYaml
| otherwise -> cabalHieYaml
when (null path) $ error "No .cabal file found!\n You may need to run stack build."
file <- T.readFile $ head path
case parseOnly parsePackage file of