From 8d31a6226ac9e1dfc75ec7521f039a43e749ed82 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 30 Mar 2014 15:14:36 -0400 Subject: remove VPS cruft --- Property/File.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Property') diff --git a/Property/File.hs b/Property/File.hs index a4b21961..9d07f130 100644 --- a/Property/File.hs +++ b/Property/File.hs @@ -1,6 +1,9 @@ module Property.File where +import System.Directory + import Property +import Utility.Directory {- Replaces all the content of a file. -} hasContent :: FilePath -> [Line] -> Property @@ -20,3 +23,8 @@ f `containsLine` l = FileProperty (f ++ " contains:" ++ l) f go - file will be written. -} lacksLine :: FilePath -> Line -> Property f `lacksLine` l = FileProperty (f ++ " remove: " ++ l) f (filter (/= l)) + +{- Note: Does not remove symlinks or non-plain-files. -} +notPresent :: FilePath -> Property +notPresent f = check (doesFileExist f) $ IOProperty (f ++ " not present") $ + makeChange $ nukeFile f -- cgit v1.2.3