diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-09-04 09:01:56 -0700 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-09-04 09:01:56 -0700 |
| commit | 160ea6015fa4b46f6cd35fcefd5df960a870d103 (patch) | |
| tree | 9aed81c1654f19882480e040a194e142f83c91f6 /src/Propellor/Property/File.hs | |
| parent | 7759d41d5371318c224ce56b45338eb3fb6a6418 (diff) | |
wip
Diffstat (limited to 'src/Propellor/Property/File.hs')
| -rw-r--r-- | src/Propellor/Property/File.hs | 14 |
1 files changed, 14 insertions, 0 deletions
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 |
