aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-03-09 10:36:55 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-03-09 10:36:55 -0700
commit7460b62ee07ae3a14530ab97022b8f2186e4a7b1 (patch)
treef59a1fd339402fb7238f166f4aeb7884b33d2474
parent8690b65b657dad6c1fa327f41b1b84e1cc38f46c (diff)
downloadconsfigurator-7460b62ee07ae3a14530ab97022b8f2186e4a7b1.tar.gz
FILE:HAS-CONTENT: use ETYPECASE
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-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."