summaryrefslogtreecommitdiff
path: root/Propellor/Property.hs
diff options
context:
space:
mode:
authorJoey Hess2014-04-10 11:02:29 -0400
committerJoey Hess2014-04-10 11:02:29 -0400
commit222e2fe8a4cc555840ce7e2f5f9015a21f325d37 (patch)
treea4144ad7aa1d4b08247d8de6043ce9cb3f9087ab /Propellor/Property.hs
parent7a0074454bbae2506c102a57add9af17a32907cc (diff)
propellor spin
Diffstat (limited to 'Propellor/Property.hs')
-rw-r--r--Propellor/Property.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Propellor/Property.hs b/Propellor/Property.hs
index c2a8972e..ca492e33 100644
--- a/Propellor/Property.hs
+++ b/Propellor/Property.hs
@@ -3,6 +3,7 @@ module Propellor.Property where
import System.Directory
import Control.Monad
import Data.Monoid
+import Control.Monad.IfElse
import Propellor.Types
import Propellor.Engine
@@ -54,7 +55,8 @@ flagFile property flagfile = Property (propertyDesc property) $
go False = do
r <- ensureProperty property
when (r == MadeChange) $
- writeFile flagfile ""
+ unlessM (doesFileExist flagfile) $
+ writeFile flagfile ""
return r
--- | Whenever a change has to be made for a Property, causes a hook