summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Postfix.hs
diff options
context:
space:
mode:
authorJoey Hess2014-07-17 21:16:03 -0400
committerJoey Hess2014-07-17 21:16:03 -0400
commite31210248defec9ca3559c20b25f4b06d94ba4da (patch)
tree0aa582445bc7fc99a051cac4d4051b76f6c8fa1c /src/Propellor/Property/Postfix.hs
parent1aab98549e2fe7183fff6c054b261a277e2abf6a (diff)
propellor spin
Diffstat (limited to 'src/Propellor/Property/Postfix.hs')
-rw-r--r--src/Propellor/Property/Postfix.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Propellor/Property/Postfix.hs b/src/Propellor/Property/Postfix.hs
index ef96e086..04ff37a2 100644
--- a/src/Propellor/Property/Postfix.hs
+++ b/src/Propellor/Property/Postfix.hs
@@ -23,3 +23,12 @@ satellite = setup `requires` installed
, ("postfix/destinations", "string", " ")
, ("postfix/mailname", "string", hn)
]
+
+-- | Sets up a file by running a property (which the filename is passed
+-- to). If the setup property makes a change, postmap will be run on the
+-- file, and postfix will be reloaded.
+mappedFile :: FilePath -> (FilePath -> Property) -> Property
+mappedFile f setup = setup f
+ `onChange` cmdProperty postmap [postmap]
+ where
+ postmap = "postmap " ++ f