diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-09 10:36:55 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-09 10:36:55 -0700 |
commit | 7460b62ee07ae3a14530ab97022b8f2186e4a7b1 (patch) | |
tree | f59a1fd339402fb7238f166f4aeb7884b33d2474 | |
parent | 8690b65b657dad6c1fa327f41b1b84e1cc38f46c (diff) | |
download | consfigurator-7460b62ee07ae3a14530ab97022b8f2186e4a7b1.tar.gz |
FILE:HAS-CONTENT: use ETYPECASE
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | src/property/file.lisp | 6 |
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." |