diff options
| author | Joey Hess <joey@kitenet.net> | 2014-04-10 17:22:32 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-04-10 17:23:43 -0400 |
| commit | 25942fb0cca0ca90933026bf959506e099ff95a4 (patch) | |
| tree | 2f84378c71abaa4458c5078e8cb8e6726bffbefd /Propellor/Property/Cmd.hs | |
| parent | 5acaf8758f752574140dd79de7996d91a81d1cd4 (diff) | |
Propellor monad is a Reader for HostAttr
So far, the hostname is only used to improve a message in withPrivData,
but I anticipate using HostAttr for a lot more.
Diffstat (limited to 'Propellor/Property/Cmd.hs')
| -rw-r--r-- | Propellor/Property/Cmd.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Propellor/Property/Cmd.hs b/Propellor/Property/Cmd.hs index c715fd2a..875c1f9a 100644 --- a/Propellor/Property/Cmd.hs +++ b/Propellor/Property/Cmd.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE PackageImports #-} + module Propellor.Property.Cmd ( cmdProperty, cmdProperty', @@ -7,6 +9,7 @@ module Propellor.Property.Cmd ( import Control.Applicative import Data.List +import "mtl" Control.Monad.Reader import Propellor.Types import Utility.Monad @@ -22,7 +25,7 @@ cmdProperty cmd params = cmdProperty' cmd params [] -- | A property that can be satisfied by running a command, -- with added environment. cmdProperty' :: String -> [String] -> [(String, String)] -> Property -cmdProperty' cmd params env = Property desc $ do +cmdProperty' cmd params env = Property desc $ liftIO $ do env' <- addEntries env <$> getEnvironment ifM (boolSystemEnv cmd (map Param params) (Just env')) ( return MadeChange |
