diff options
Diffstat (limited to 'src/Reaktor/Plugins/System')
-rw-r--r-- | src/Reaktor/Plugins/System/Internal.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Reaktor/Plugins/System/Internal.hs b/src/Reaktor/Plugins/System/Internal.hs index 45b7329..aa60452 100644 --- a/src/Reaktor/Plugins/System/Internal.hs +++ b/src/Reaktor/Plugins/System/Internal.hs @@ -5,7 +5,8 @@ module Reaktor.Plugins.System.Internal where import Prelude.Extended import Data.Aeson import Reaktor () - +import Text.Regex.PCRE.Light (Regex) +import qualified Text.Regex.PCRE.Light as RE -- TODO this needs better names :) @@ -46,7 +47,7 @@ instance FromJSON Config where data Hook = Hook { hActivate :: Activate - , hPattern :: Maybe ByteString + , hPattern :: Maybe Regex , hCommand :: CaptureOr Command , hArguments :: [CaptureOr Text] , hWorkDir :: Maybe FilePath @@ -60,7 +61,7 @@ instance FromJSON Hook where Object v -> Hook <$> v .:? "activate" .!= Query - <*> v .:? "pattern" + <*> (fmap (flip RE.compile [RE.utf8]) <$> v .:? "pattern") <*> v .: "command" <*> v .:? "arguments" .!= [] <*> v .:? "workdir" |