project-template 0.1.1 → 0.1.2
raw patch · 2 files changed
+7/−4 lines, 2 files
Files
- Text/ProjectTemplate.hs +6/−3
- project-template.cabal +1/−1
Text/ProjectTemplate.hs view
@@ -23,6 +23,9 @@ import Filesystem (createTree) import Filesystem.Path.CurrentOS (directory, fromText, toText) import qualified Data.Conduit.Base64+import qualified Data.Conduit.Binary as CB+import qualified Data.Conduit.Text as CT+import qualified Data.Conduit.List as CL -- | Create a template file from a stream of file/contents combinations. --@@ -32,7 +35,7 @@ => GInfConduit (FilePath, m ByteString) m ByteString createTemplate = awaitForever $ \(fp, getBS) -> do bs <- lift getBS- case yield bs $$ decodeUtf8 =$ sinkNull of+ case yield bs $$ CT.decode CT.utf8 =$ sinkNull of Nothing -> do yield "{-# START_FILE BASE64 " yield $ encodeUtf8 $ either id id $ toText fp@@ -64,7 +67,7 @@ -> (Text -> Text) -- ^ fix each input line, good for variables -> Sink ByteString m () unpackTemplate perFile fixLine =- decodeUtf8 =$ lines =$ map fixLine =$ start+ CT.decode CT.utf8 =$ CT.lines =$ CL.map fixLine =$ start where start = await >>= maybe (return ()) go@@ -120,7 +123,7 @@ -> FileReceiver m receiveFS root rel = do liftIO $ createTree $ directory fp- writeFile fp+ CB.sinkFile $ unpack fp where fp = root </> rel
project-template.cabal view
@@ -1,5 +1,5 @@ name: project-template-version: 0.1.1+version: 0.1.2 synopsis: Specify Haskell project templates and generate files description: See initial blog post for explanation: <http://www.yesodweb.com/blog/2012/09/project-templates> homepage: https://github.com/fpco/haskell-ide