aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/property/file.lisp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/property/file.lisp b/src/property/file.lisp
index 7d18e94..5bebad6 100644
--- a/src/property/file.lisp
+++ b/src/property/file.lisp
@@ -32,9 +32,9 @@ point in doing that here because WRITEFILE is synchronous."
"Ensure there is a file at PATH whose content is CONTENT.
CONTENT can be a list of lines or a single string."
(declare (indent 1))
- (:apply (writefile path (if (listp content)
- (unlines content)
- (format nil "~A~&" content)))))
+ (:apply (writefile path (etypecase content
+ (cons (unlines content))
+ (string (format nil "~A~&" content))))))
(defprop contains-lines :posix (path lines)
"Ensure there is a file at PATH containing each of LINES once."