toodles 1.0.2 → 1.0.3
raw patch · 3 files changed
+17/−16 lines, 3 filesdep +extra
Dependencies added: extra
Files
- README.md +1/−1
- src/Server.hs +12/−14
- toodles.cabal +4/−1
README.md view
@@ -98,7 +98,7 @@ ### Installing The easiest way to get toodles is via [stack](https://docs.haskellstack.org).-Just a `stack install toodles` and you're done! Alternatively, with GHC 8.4.3+Just a `stack install --resolver=lts-12.14 toodles` and you're done! Alternatively, with GHC 8.4.3 you can use [cabal](https://www.haskell.org/cabal/download.html). If there is desire for it I can look into precompiled distribution.
src/Server.hs view
@@ -26,9 +26,8 @@ import qualified Data.Yaml as Y import Servant import System.Directory-import System.IO.HVFS+import System.Directory.Extra import qualified System.IO.Strict as SIO-import System.Path import System.Path.NameManip import Text.Blaze.Html5 (Html) import qualified Text.Blaze.Html5 as BZ@@ -319,7 +318,7 @@ getAllFiles (ToodlesConfig ignoredPaths _) basePath = E.catch (do putStrLn $ printf "Running toodles for path: %s" basePath- files <- recurseDir SystemFS basePath+ files <- listFilesInside (return . not . ignorePath) basePath let validFiles = filter isValidFile files mapM (\f ->@@ -333,20 +332,19 @@ where - isValidFile :: FilePath -> Bool- isValidFile path = fileHasValidExtension && not ignoreFile+ ignorePath :: FilePath -> Bool+ ignorePath path =+ let p = T.pack path+ in T.isInfixOf "node_modules" p || T.isSuffixOf "pb.go" p ||+ T.isSuffixOf "_pb2.py" p ||+ any (\r -> path =~ r :: Bool) ignoredPaths - where+ fileHasValidExtension :: FilePath -> Bool+ fileHasValidExtension path = any (\ext -> ext `T.isSuffixOf` T.pack path) (map extension fileTypeToComment) - fileHasValidExtension :: Bool- fileHasValidExtension = any (\ext -> ext `T.isSuffixOf` T.pack path) (map extension fileTypeToComment)+ isValidFile :: FilePath -> Bool+ isValidFile path = (not $ ignorePath path) && fileHasValidExtension path - ignoreFile :: Bool- ignoreFile =- let p = T.pack path- in T.isInfixOf "node_modules" p || T.isSuffixOf "pb.go" p ||- T.isSuffixOf "_pb2.py" p ||- any (\r -> path =~ r :: Bool) ignoredPaths mapHead :: (a -> a) -> [a] -> [a] mapHead f (x:xs) = f x : xs
toodles.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.12 name: toodles-version: 1.0.2+version: 1.0.3 license: MIT license-file: LICENSE copyright: 2018 Avi Press@@ -50,6 +50,7 @@ blaze-html ==0.9.1.1, cmdargs ==0.10.20, directory ==1.3.1.5,+ extra ==1.6.13, hspec >=2.4.4 && <2.6, hspec-expectations >=0.8.2 && <0.9, megaparsec ==6.5.0,@@ -83,6 +84,7 @@ blaze-html ==0.9.1.1, cmdargs ==0.10.20, directory ==1.3.1.5,+ extra ==1.6.13, hspec >=2.4.4 && <2.6, hspec-expectations >=0.8.2 && <0.9, megaparsec ==6.5.0,@@ -116,6 +118,7 @@ blaze-html ==0.9.1.1, cmdargs ==0.10.20, directory ==1.3.1.5,+ extra ==1.6.13, hspec >=2.4.4 && <2.6, hspec-expectations >=0.8.2 && <0.9, megaparsec ==6.5.0,