Skip to content

Commit

Permalink
give an error when a template doesn't include a .cabal file
Browse files Browse the repository at this point in the history
  • Loading branch information
kadoban committed Dec 22, 2015
1 parent cc4552b commit 7fc1f82
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Stack/New.hs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ applyTemplate project template nonceParams dir templateText = do
throwM (InvalidTemplate template (show e)))
when (M.null files) $
throwM (InvalidTemplate template "Template did not specify any files.")
unless (any (".cabal" `isSuffixOf`) . M.keys $ files) $
throwM (InvalidTemplate template "Template does not contain a .cabal\
\ file, and the result could not be\
\ made into a stack project.")
liftM
M.fromList
(mapM
Expand Down

0 comments on commit 7fc1f82

Please sign in to comment.