Avoid extra untupling in this case for now
This commit is contained in:
parent
5d5dbbec74
commit
e770a350d6
|
@ -26,6 +26,7 @@ module DependencyGenerator
|
||||||
, convertImage
|
, convertImage
|
||||||
, saveFile
|
, saveFile
|
||||||
, copyFile
|
, copyFile
|
||||||
|
, copyFile'
|
||||||
, makeDir
|
, makeDir
|
||||||
, runPandoc
|
, runPandoc
|
||||||
) where
|
) where
|
||||||
|
@ -204,6 +205,9 @@ copyFile (a, b) = do
|
||||||
b' <- toToken b
|
b' <- toToken b
|
||||||
runFunctionIO' CopyFile $ TupleToken (a', b')
|
runFunctionIO' CopyFile $ TupleToken (a', b')
|
||||||
|
|
||||||
|
copyFile' :: Token (FilePath, FilePath) -> DepGenM ()
|
||||||
|
copyFile' = runFunctionIO' CopyFile
|
||||||
|
|
||||||
makeDir :: TokenableTo FilePath a => a -> DepGenM ()
|
makeDir :: TokenableTo FilePath a => a -> DepGenM ()
|
||||||
makeDir a = runFunctionIO' MakeDir =<< toToken a
|
makeDir a = runFunctionIO' MakeDir =<< toToken a
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ handleRecipeDir outputDir template indexName dir = do
|
||||||
imageFilenames <- filterDepGenM areImageFilenames dirContents
|
imageFilenames <- filterDepGenM areImageFilenames dirContents
|
||||||
imagePaths <- mapDepGenM (curry joinPaths dir) imageFilenames
|
imagePaths <- mapDepGenM (curry joinPaths dir) imageFilenames
|
||||||
imagePathsOut <- mapDepGenM (curry joinPaths outputDir) imageFilenames
|
imagePathsOut <- mapDepGenM (curry joinPaths outputDir) imageFilenames
|
||||||
mapDepGenM_ ((copyFile =<<) . untupleDepGenM) (ZipToken (imagePaths, imagePathsOut))
|
mapDepGenM_ copyFile' (ZipToken (imagePaths, imagePathsOut))
|
||||||
thumbnailImagePaths <- mapDepGenM (thumbnailImagePath outputDir) imageFilenames
|
thumbnailImagePaths <- mapDepGenM (thumbnailImagePath outputDir) imageFilenames
|
||||||
mapDepGenM_
|
mapDepGenM_
|
||||||
(\files -> convertImage (files, inject $ ResizeToWidth 800))
|
(\files -> convertImage (files, inject $ ResizeToWidth 800))
|
||||||
|
|
Loading…
Reference in New Issue