From e31210248defec9ca3559c20b25f4b06d94ba4da Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 17 Jul 2014 21:16:03 -0400 Subject: propellor spin --- src/Propellor/Property/Postfix.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/Propellor/Property/Postfix.hs') 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 -- cgit v1.2.3