Fix add-handler (fixes #1273)
This commit is contained in:
parent
a04d2b25ba
commit
d1495bad85
@ -120,9 +120,20 @@ fixApp name =
|
|||||||
| otherwise = x : go xs
|
| otherwise = x : go xs
|
||||||
|
|
||||||
fixCabal :: String -> String -> String
|
fixCabal :: String -> String -> String
|
||||||
fixCabal name =
|
fixCabal name orig =
|
||||||
unlines . reverse . go . reverse . lines
|
unlines $ (reverse $ go $ reverse libraryLines) ++ restLines
|
||||||
where
|
where
|
||||||
|
origLines = lines orig
|
||||||
|
|
||||||
|
(libraryLines, restLines) = break isExeTestBench origLines
|
||||||
|
|
||||||
|
isExeTestBench x = any
|
||||||
|
(\prefix -> prefix `isPrefixOf` x)
|
||||||
|
[ "executable"
|
||||||
|
, "test-suite"
|
||||||
|
, "benchmark"
|
||||||
|
]
|
||||||
|
|
||||||
l = " Handler." ++ name
|
l = " Handler." ++ name
|
||||||
|
|
||||||
go [] = [l]
|
go [] = [l]
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
## 1.4.18.3
|
||||||
|
|
||||||
|
* Adding a new handler adds it under wrong stanza [#1273](https://github.com/yesodweb/yesod/issues/1273)
|
||||||
|
|
||||||
## 1.4.18.2
|
## 1.4.18.2
|
||||||
|
|
||||||
* Work around change in behavior in newer optparse-applicative ([mailing list discussion](https://groups.google.com/d/msg/yesodweb/BrTkMKFREgU/AKVc9AK2AQAJ))
|
* Work around change in behavior in newer optparse-applicative ([mailing list discussion](https://groups.google.com/d/msg/yesodweb/BrTkMKFREgU/AKVc9AK2AQAJ))
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-bin
|
name: yesod-bin
|
||||||
version: 1.4.18.2
|
version: 1.4.18.3
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user