aboutsummaryrefslogtreecommitdiff
path: root/src/util.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-06-08 13:25:21 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-06-08 13:25:21 -0700
commit1393bb0305bb80dfd5ebe57268b55e7d0dfa8567 (patch)
treea8d650006181e0f4124475036fdad806d3904b77 /src/util.lisp
parente76441b7186ebab16fa7214bad96b8999a94865e (diff)
downloadconsfigurator-1393bb0305bb80dfd5ebe57268b55e7d0dfa8567.tar.gz
FILE:DIRECTORY-DOES-NOT-EXIST: simplify not deleting non-dirs
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/util.lisp')
-rw-r--r--src/util.lisp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util.lisp b/src/util.lisp
index 9dd417d..1dd2b44 100644
--- a/src/util.lisp
+++ b/src/util.lisp
@@ -167,6 +167,11 @@ one solution is to convert your property to a :LISP property."
(namestring
(enough-pathname pathname (pathname-directory-pathname pathname)))))
+(defun ensure-trailing-slash (namestring)
+ (if (string-suffix-p namestring "/")
+ namestring
+ (strcat namestring "/")))
+
(defun drop-trailing-slash (namestring)
(if (string-suffix-p namestring "/")
(subseq namestring 0 (1- (length namestring)))