Collapse paths in keter bundle
This commit is contained in:
parent
814157a018
commit
848b1ab3e5
@ -1,3 +1,7 @@
|
|||||||
|
## 1.4.9.2
|
||||||
|
|
||||||
|
* Collapse paths in keter bundles, see [mailing list thread](https://groups.google.com/d/msg/yesodweb/Ndd310qfSEc/pZOXldsKowsJ)
|
||||||
|
|
||||||
## 1.4.9
|
## 1.4.9
|
||||||
|
|
||||||
* Command line options for `yesod init` [#986](https://github.com/yesodweb/yesod/pull/986)
|
* Command line options for `yesod init` [#986](https://github.com/yesodweb/yesod/pull/986)
|
||||||
|
|||||||
@ -60,13 +60,19 @@ keter cabal noBuild noCopyTo = do
|
|||||||
go ("exec", String s) = tellFile s
|
go ("exec", String s) = tellFile s
|
||||||
go ("extraFiles", Array a) = Fold.mapM_ tellExtra a
|
go ("extraFiles", Array a) = Fold.mapM_ tellExtra a
|
||||||
go (_, v') = findFiles v'
|
go (_, v') = findFiles v'
|
||||||
tellFile s = tell ["config" </> T.unpack s]
|
tellFile s = tell [collapse $ "config" </> T.unpack s]
|
||||||
tellExtra (String s) = tellFile s
|
tellExtra (String s) = tellFile s
|
||||||
tellExtra _ = error "extraFiles should be a flat array"
|
tellExtra _ = error "extraFiles should be a flat array"
|
||||||
findFiles (Array v) = Fold.mapM_ findFiles v
|
findFiles (Array v) = Fold.mapM_ findFiles v
|
||||||
findFiles _ = return ()
|
findFiles _ = return ()
|
||||||
bundleFiles = execWriter $ findFiles $ Object value
|
bundleFiles = execWriter $ findFiles $ Object value
|
||||||
|
|
||||||
|
collapse = T.unpack . T.intercalate "/" . collapse' . T.splitOn "/" . T.pack
|
||||||
|
collapse' (_:"..":rest) = collapse' rest
|
||||||
|
collapse' (".":xs) = collapse' xs
|
||||||
|
collapse' (x:xs) = x : collapse' xs
|
||||||
|
collapse' [] = []
|
||||||
|
|
||||||
unless noBuild $ do
|
unless noBuild $ do
|
||||||
run cabal ["clean"]
|
run cabal ["clean"]
|
||||||
run cabal ["configure"]
|
run cabal ["configure"]
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-bin
|
name: yesod-bin
|
||||||
version: 1.4.9.1
|
version: 1.4.9.2
|
||||||
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