diff --git a/ChangeLog.md b/ChangeLog.md index 9eceb2233f..d41d0e5f94 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -6,6 +6,9 @@ Release notes: * The hash used as a key for Stack's pre-compiled package cache has changed, following the dropping of support for Cabal versions older than `1.24.0.0`. +* The check used in `stack new` now does a suffix match to find `package.yaml` + rather than an exact match. This supports defining templates with packages in + subdirectories. **Changes since v2.13.1:** diff --git a/src/Stack/New.hs b/src/Stack/New.hs index 1fbf42fc2d..62ad9e607b 100644 --- a/src/Stack/New.hs +++ b/src/Stack/New.hs @@ -520,7 +520,7 @@ applyTemplate project template nonceParams dir templateText = do template (flow "the template does not contain any files.") - let isPkgSpec f = ".cabal" `L.isSuffixOf` f || f == "package.yaml" + let isPkgSpec f = ".cabal" `L.isSuffixOf` f || "package.yaml" `L.isSuffixOf` f unless (any isPkgSpec . M.keys $ files) $ prettyThrowM $ TemplateInvalid template