diff options
| author | Joey Hess <joey@kitenet.net> | 2014-04-01 01:12:05 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-04-01 01:12:05 -0400 |
| commit | 90f86b8b2bb7f0a3c834387827c9ec2e1876f342 (patch) | |
| tree | 10e74b0a52f4987c6f7e9cf2abf756275e0cefae /Propellor/Property/File.hs | |
| parent | d53729495efe7174239deab3b5dd71204543b0d0 (diff) | |
not quite working docker container interface
Diffstat (limited to 'Propellor/Property/File.hs')
| -rw-r--r-- | Propellor/Property/File.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Propellor/Property/File.hs b/Propellor/Property/File.hs index 02bf27c0..f3065d21 100644 --- a/Propellor/Property/File.hs +++ b/Propellor/Property/File.hs @@ -38,3 +38,8 @@ fileProperty desc a f = Property desc $ go =<< doesFileExist f then noChange else makeChange $ viaTmp writeFile f (unlines ls') go False = makeChange $ writeFile f (unlines $ a []) + +-- | Ensures a directory exists. +dirExists :: FilePath -> Property +dirExists d = check (doesDirectoryExist d) $ Property (d ++ " exists") $ + makeChange $ createDirectoryIfMissing True d |
