diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-09 10:35:42 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-09 10:35:42 -0700 |
commit | 8690b65b657dad6c1fa327f41b1b84e1cc38f46c (patch) | |
tree | 750c1d12cb8e34f5127186e7f5cc54d5ca9b243b | |
parent | 68235a27f4f1d9c71327e800bfa3f8579989ddde (diff) | |
download | consfigurator-8690b65b657dad6c1fa327f41b1b84e1cc38f46c.tar.gz |
FILE:HAS-CONTENT: if passed a string, ensure it ends in a newline
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | src/property/file.lisp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/property/file.lisp b/src/property/file.lisp index f536c79..7d18e94 100644 --- a/src/property/file.lisp +++ b/src/property/file.lisp @@ -32,7 +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) content)))) + (:apply (writefile path (if (listp content) + (unlines content) + (format nil "~A~&" content))))) (defprop contains-lines :posix (path lines) "Ensure there is a file at PATH containing each of LINES once." |