diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-05 14:16:19 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-05 14:16:19 -0700 |
commit | 8bd3e70d923fc2001d7f8aa5027e7abbcef58ee8 (patch) | |
tree | c1c37dc82237854bbeff7703acc206487e09936d /src/property/file.lisp | |
parent | afbb72dfca9489f0e9b56171d9c9df6baa015798 (diff) | |
download | consfigurator-8bd3e70d923fc2001d7f8aa5027e7abbcef58ee8.tar.gz |
rework FILE:HAS-CONTENT and add FILE:HAS-CONTENT-LINES
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/file.lisp')
-rw-r--r-- | src/property/file.lisp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/property/file.lisp b/src/property/file.lisp index c398ace..79b57da 100644 --- a/src/property/file.lisp +++ b/src/property/file.lisp @@ -28,7 +28,11 @@ point in doing that here because WRITEFILE is synchronous." :no-change (writefile file (unlines new-lines) :try-preserve t)))) -(defprop has-content :posix (path lines) +(defprop has-content :posix (path content) + "Ensure there is a file at PATH whose content is the string CONTENT." + (:apply (writefile path content))) + +(defprop has-content-lines :posix (path lines) "Ensure there is a file at PATH whose lines are the elements of LINES." (:apply (writefile path (unlines lines)))) |