Collapse paths in keter bundle

This commit is contained in:
Michael Snoyman 2015-05-19 08:17:46 +03:00
parent 814157a018
commit 848b1ab3e5
3 changed files with 12 additions and 2 deletions

View File

@ -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
* Command line options for `yesod init` [#986](https://github.com/yesodweb/yesod/pull/986)

View File

@ -60,13 +60,19 @@ keter cabal noBuild noCopyTo = do
go ("exec", String s) = tellFile s
go ("extraFiles", Array a) = Fold.mapM_ tellExtra a
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 _ = error "extraFiles should be a flat array"
findFiles (Array v) = Fold.mapM_ findFiles v
findFiles _ = return ()
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
run cabal ["clean"]
run cabal ["configure"]

View File

@ -1,5 +1,5 @@
name: yesod-bin
version: 1.4.9.1
version: 1.4.9.2
license: MIT
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>