From 97c6103625c4a45ae27d0c4ecfcdb70032be3bb9 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 5 Mar 2021 14:26:10 -0700 Subject: in fact, combine HAS-CONTENT and HAS-CONTENT-LINES Signed-off-by: Sean Whitton --- src/package.lisp | 1 - src/property/file.lisp | 9 +++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/package.lisp b/src/package.lisp index 7091f51..7e2e632 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -182,7 +182,6 @@ (:use #:cl #:consfigurator #:alexandria) (:local-nicknames (#:re #:cl-ppcre)) (:export #:has-content - #:has-content-lines #:contains-lines #:data-uploaded #:host-data-uploaded diff --git a/src/property/file.lisp b/src/property/file.lisp index 79b57da..45eb176 100644 --- a/src/property/file.lisp +++ b/src/property/file.lisp @@ -29,12 +29,9 @@ point in doing that here because WRITEFILE is synchronous." (writefile file (unlines new-lines) :try-preserve t)))) (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)))) + "Ensure there is a file at PATH whose content is CONTENT. +CONTENT can be a list of lines or a single string." + (:apply (writefile path (if (listp content) (unlines content) content)))) (defprop contains-lines :posix (path lines) "Ensure there is a file at PATH containing each of LINES once." -- cgit v1.2.3