aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--reaktor2.cabal2
-rw-r--r--src/Reaktor/Plugins/System.hs1
-rw-r--r--src/Reaktor/Plugins/System/Internal.hs2
3 files changed, 4 insertions, 1 deletions
diff --git a/reaktor2.cabal b/reaktor2.cabal
index 5d19f78..5780c1e 100644
--- a/reaktor2.cabal
+++ b/reaktor2.cabal
@@ -1,5 +1,5 @@
name: reaktor2
-version: 0.2.0
+version: 0.2.1
license: MIT
author: tv <tv@krebsco.de>
maintainer: tv <tv@krebsco.de>
diff --git a/src/Reaktor/Plugins/System.hs b/src/Reaktor/Plugins/System.hs
index de96a61..6894797 100644
--- a/src/Reaktor/Plugins/System.hs
+++ b/src/Reaktor/Plugins/System.hs
@@ -139,6 +139,7 @@ run1 Config{..} Actions{..} Hook{..} prefix msgtarget text = do
M.toList $ mconcat
[ M.fromList extraEnv
, maybe mempty id scEnv
+ , maybe mempty id hEnv
, M.fromList baseEnv
]
diff --git a/src/Reaktor/Plugins/System/Internal.hs b/src/Reaktor/Plugins/System/Internal.hs
index e4356df..82aad6c 100644
--- a/src/Reaktor/Plugins/System/Internal.hs
+++ b/src/Reaktor/Plugins/System/Internal.hs
@@ -52,6 +52,7 @@ data Hook = Hook
, hPattern :: Maybe Regex
, hCommand :: CaptureOr SystemCommand
, hArguments :: [CaptureOr Text]
+ , hEnv :: Maybe (HashMap String String)
, hWorkDir :: Maybe FilePath
, hCommands :: HashMap Text SystemCommand
, hTimeout :: Maybe Int
@@ -66,6 +67,7 @@ instance FromJSON Hook where
<*> (fmap (flip RE.compile [RE.utf8]) <$> v .:? "pattern")
<*> v .: "command"
<*> v .:? "arguments" .!= []
+ <*> v .:? "env"
<*> v .:? "workdir"
<*> v .:? "commands" .!= mempty
<*> (fmap (*1000000) <$> v .:? "timeoutSec" .!= Just 10)