From c3674b0b894fe5e852945555c936d8a12924d87d Mon Sep 17 00:00:00 2001 From: Joshua Simmons Date: Mon, 21 Dec 2015 21:25:57 -0700 Subject: [PATCH] give an error when a template doesn't include a .cabal file fixes #1535 --- src/Stack/New.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Stack/New.hs b/src/Stack/New.hs index 5ec545b010..dcda49d7c2 100644 --- a/src/Stack/New.hs +++ b/src/Stack/New.hs @@ -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