@@ -25,15 +25,16 @@ elemBlock path info = writeElemBlock . elemBlockData
25
25
writeElemBlock :: ElemBlockData -> IO ()
26
26
writeElemBlock (ElemBlockData flatPatterns rulesTree) =
27
27
do
28
- let debugPath = path </> " debug "
29
- filteredInfo = filter ( (||) <$> not . startswith " Url: " <*> startswith " Url: http " ) info
28
+ let filteredInfo = filter ( (||) <$> not . startswith " Url: " <*> startswith " Url: http " ) info
29
+ -- debugPath = path </> "debug"
30
30
createDirectoryIfMissing True path
31
31
cont <- getDirectoryContents path
32
32
_ <- sequence $ removeOld <$> cont
33
- createDirectoryIfMissing True debugPath
33
+ -- createDirectoryIfMissing True debugPath
34
34
-- writeBlockTree path debugPath rulesTree
35
35
writeBlockTree path rulesTree
36
- writePatterns_with_debug filteredInfo (path </> " ab2p.common.css" ) (debugPath </> " ab2p.common.css" ) flatPatterns
36
+ writePatterns_with_debug filteredInfo (path </> " ab2p.common.css" ) " " flatPatterns
37
+ -- writePatterns_with_debug filteredInfo (path </> "ab2p.common.css") (debugPath </> "ab2p.common.css") flatPatterns
37
38
removeOld entry' =
38
39
let entry = path </> entry'
39
40
in do
@@ -64,9 +65,10 @@ elemBlock path info = writeElemBlock . elemBlockData
64
65
writePatterns_with_debug _ _ _ [] = return ()
65
66
writePatterns_with_debug info' normalFilename debugFilename patterns =
66
67
do
67
- writeCssFile debugFilename $ intercalate " \n " $ (++ Templates. blockCss) <$> patterns
68
68
writeCssFile normalFilename $ intercalate " \n " ((++ Templates. blockCss) . intercalate " ," <$>
69
- splitEvery 4000 patterns)
69
+ splitEvery 4000 patterns)
70
+ when (debugFilename /= " " ) $
71
+ writeCssFile debugFilename $ intercalate " \n " $ (++ Templates. blockCss) <$> patterns
70
72
where
71
73
splitEvery n = takeWhile (not . null ) . unfoldr (Just . splitAt n)
72
74
writeCssFile filename content =
0 commit comments