From 160ea6015fa4b46f6cd35fcefd5df960a870d103 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 4 Sep 2015 09:01:56 -0700 Subject: wip --- src/Propellor/Property/File.hs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/Propellor/Property/File.hs') diff --git a/src/Propellor/Property/File.hs b/src/Propellor/Property/File.hs index adced166..239095c7 100644 --- a/src/Propellor/Property/File.hs +++ b/src/Propellor/Property/File.hs @@ -105,3 +105,17 @@ mode :: FilePath -> FileMode -> Property NoInfo mode f v = property (f ++ " mode " ++ show v) $ do liftIO $ modifyFileMode f (\_old -> v) noChange + +-- | Ensures that the second directory exists and has identical contents +-- as the first directory. +-- +-- Implemented with rsync. +-- +-- rsync -av 1/ 2/ --exclude='2/*' --delete --delete-excluded +copyDir :: FilePath -> FilePath -> Property NoInfo +copyDir src dest = copyDir' src dest [] + +-- | Like copyDir, but avoids copying anything into directories +-- in the list. Those directories are created, but will be kept empty. +copyDir' :: FilePath -> FilePath -> [FilePath] -> Property NoInfo +copyDir' src dest exclude = undefined -- cgit v1.3-2-g0d8e