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 d0d2cbf commit c3674b0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Stack/New.hs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ applyTemplate project template nonceParams dir templateText = do
throwM (InvalidTemplate template (show e)))
when (M.null files) $
throwM (InvalidTemplate template "Template does not contain any files")
unless (any (".cabal" `isSuffixOf`) . M.keys $ files) $
throwM (InvalidTemplate template "Template does not contain a .cabal\
\ file")
liftM
M.fromList
(mapM
Expand Down

0 comments on commit c3674b0

Please sign in to comment.