From e66c70d1dfe8581e7d6d82b14e278d91e0f92b6a Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 2 Jul 2021 11:07:47 -0700 Subject: WITH-FLAGFILE: 'mkdir -p' flag file's directory & 'rm -f' on unapply Avoids a failure if the flag file's directory does not exist, and enables unapplying the property before it has ever been applied to a host. Signed-off-by: Sean Whitton --- src/combinator.lisp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/combinator.lisp') diff --git a/src/combinator.lisp b/src/combinator.lisp index 2f2d6f6..68642ea 100644 --- a/src/combinator.lisp +++ b/src/combinator.lisp @@ -258,10 +258,12 @@ FLAGFILE exists, PROPAPPS are assumed to all be already applied." (remote-exists-p flagfile)) :apply (lambda-ignoring-args (prog1 (propappapply propapp) + (mrun "mkdir" "-p" + (pathname-directory-pathname flagfile)) (mrun "touch" flagfile))) :unapply (lambda-ignoring-args (prog1 (propappunapply propapp) - (mrun "rm" flagfile))) + (mrun "rm" "-f" flagfile))) :args (cdr propapp))) (define-function-property-combinator with-unapply (&rest propapps) -- cgit v1.2.3