Skip to content

Commit

Permalink
dont output a warning for each boring entry
Browse files Browse the repository at this point in the history
  • Loading branch information
agrafix committed Aug 23, 2015
1 parent cdeb648 commit 227ea6d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/Ignore/Builder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ registerGlob globPattern =
#ifdef NO_PCRE
registerRegex :: MonadIO m => T.Text -> CheckerBuilderT m ()
registerRegex rePattern =
CheckerBuilderT $
do liftIO $ putStrLn $ "Warning: compile with --without-pcre flag. Ignoring " ++ T.unpack rePattern
return ()
CheckerBuilderT $ return ()
#else
registerRegex :: Monad m => T.Text -> CheckerBuilderT m ()
registerRegex rePattern =
Expand Down
9 changes: 9 additions & 0 deletions src/Ignore/VCS/Darcs.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE TemplateHaskell #-}
module Ignore.VCS.Darcs
( makeChecker
Expand All @@ -11,8 +12,16 @@ import Control.Monad.Trans
import Path
import qualified Data.Text as T

#ifdef NO_PCRE
makeChecker :: MonadIO m => [T.Text] -> CheckerBuilderT m ()
makeChecker _ =
liftIO $
do putStrLn "The ignore library was compiled with the without-pcre flag."
putStrLn "This means that we can not handle darcs boring files for now."
#else
makeChecker :: MonadIO m => [T.Text] -> CheckerBuilderT m ()
makeChecker = go
#endif

file :: Path Rel File
file = $(mkRelDir "_darcs/prefs") </> $(mkRelFile "boring")
Expand Down
10 changes: 9 additions & 1 deletion src/Ignore/VCS/Mercurial.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
module Ignore.VCS.Mercurial
Expand All @@ -13,7 +14,14 @@ import Path
import qualified Data.Text as T

makeChecker :: MonadIO m => [T.Text] -> CheckerBuilderT m ()
makeChecker = go registerRegex
makeChecker files =
do
#ifdef NO_PCRE
liftIO $
do putStrLn "The ignore library was compiled with the without-pcre flag."
putStrLn "This means it will only support 'syntax: glob' mercurial blocks"
#endif
go registerRegex files

file :: Path Rel File
file = $(mkRelFile ".hgignore")
Expand Down

0 comments on commit 227ea6d

Please sign in to comment.