diff options
| author | Joey Hess <joeyh@joeyh.name> | 2014-12-09 00:34:57 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2014-12-09 00:34:57 -0400 |
| commit | 4f309c5cd61a6af5ecade56099ed605c0be72920 (patch) | |
| tree | 30586152f2eb484c4de93b373b1694a84c278cbb /src/Propellor/Property/File.hs | |
| parent | 914f762d01f43b31920667049362d6f56f61c121 (diff) | |
| parent | b22201e36b608ba38f4d741268d04e7de3a966b8 (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Property/File.hs')
| -rw-r--r-- | src/Propellor/Property/File.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Propellor/Property/File.hs b/src/Propellor/Property/File.hs index d2296354..a1a86763 100644 --- a/src/Propellor/Property/File.hs +++ b/src/Propellor/Property/File.hs @@ -62,11 +62,11 @@ fileProperty' :: (FilePath -> String -> IO ()) -> Desc -> ([Line] -> [Line]) -> fileProperty' writer desc a f = property desc $ go =<< liftIO (doesFileExist f) where go True = do - ls <- liftIO $ lines <$> readFile f - let ls' = a ls - if ls' == ls + old <- liftIO $ readFile f + let new = unlines (a (lines old)) + if old == new then noChange - else makeChange $ viaTmp updatefile f (unlines ls') + else makeChange $ viaTmp updatefile f new go False = makeChange $ writer f (unlines $ a []) -- viaTmp makes the temp file mode 600. |
