Commit 51618d8a authored by Jan Koniarik's avatar Jan Koniarik
Browse files

basic lazy generation of files

parent 7e1e2f7f
......@@ -9,7 +9,7 @@ import Control.Monad.State.Lazy
import Data.ByteString as BS
( readFile )
import Data.ByteString.Lazy as BSL
( writeFile )
( writeFile, unpack )
import qualified Data.Csv as CSV
import Data.Fixed ( mod' )
import qualified Data.HashMap.Lazy as HM
......@@ -676,7 +676,7 @@ generateBOM walker pconf = do
write_f (filebase, p) = do
let filename = "out/bom/" ++ filebase ++ ".csv"
createDirectoryIfMissing True $ takeDirectory filename
BSL.writeFile filename (CSV.encode $ parts_to_CSV p)
writeFileIfChanged filename (show $ BSL.unpack $ CSV.encode $ parts_to_CSV p)
write_sum :: [ExtrPart] -> IO ()
write_sum parts = do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment