diff options
| author | Sean Whitton <spwhitton@spwhitton.name> | 2017-01-31 19:58:49 -0700 |
|---|---|---|
| committer | Sean Whitton <spwhitton@spwhitton.name> | 2017-01-31 19:58:49 -0700 |
| commit | 6a6aa61b54966544987063df9337dc9d2ff058a5 (patch) | |
| tree | 72219da64de8fb82ee4707c70cb428d6bac7d524 /src/Propellor/Property/File.hs | |
| parent | 0255bae984648a34303d01ee674cc288c47a523c (diff) | |
document File.containsLines
Diffstat (limited to 'src/Propellor/Property/File.hs')
| -rw-r--r-- | src/Propellor/Property/File.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Propellor/Property/File.hs b/src/Propellor/Property/File.hs index 95fc6f81..b6f1a8d6 100644 --- a/src/Propellor/Property/File.hs +++ b/src/Propellor/Property/File.hs @@ -21,6 +21,12 @@ f `hasContent` newcontent = fileProperty containsLine :: FilePath -> Line -> Property UnixLike f `containsLine` l = f `containsLines` [l] +-- | Ensures that a list of lines are present in a file, adding any that are not +-- to the end of the file. +-- +-- Note that this property does not guarantee that the lines will appear +-- consecutively, nor in the order specified. If you need either of these, use +-- 'File.containsBlock'. containsLines :: FilePath -> [Line] -> Property UnixLike f `containsLines` ls = fileProperty (f ++ " contains:" ++ show ls) go f where |
