summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru-Sergiu Marton <brown121407@member.fsf.org>2020-04-18 14:55:50 +0300
committerAlexandru-Sergiu Marton <brown121407@member.fsf.org>2020-04-18 14:55:50 +0300
commitfaf8bd1e29e860477db650df8a65c8ae159d2dba (patch)
tree4e73b4a38dc9599062188ffe8729186d60e7ad8b
parent6e27bc5ca59b747886874f239726267755de61a5 (diff)
Complete copy.
-rw-r--r--f.scm14
1 files changed, 11 insertions, 3 deletions
diff --git a/f.scm b/f.scm
index ac1b844..57785c8 100644
--- a/f.scm
+++ b/f.scm
@@ -137,7 +137,7 @@
(letrec ((contents (ls path #:hidden #t))
(loop (lambda (contents)
(when (not (null? contents))
- (let ((file (string-append path file-name-separator-string (car contents))))
+ (let ((file (string-append path "/" (car contents))))
(traverse file f #:files-only files-only))
(loop (cdr contents))))))
(when (not files-only)
@@ -159,7 +159,7 @@
(letrec ((loop (lambda (contents)
(when (not (null? contents))
(delete
- (string-append path file-name-separator-string (car contents))
+ (string-append path "/" (car contents))
;; TODO: replace ^ with smarter path building
recursive)
(loop (cdr contents))))))
@@ -175,7 +175,15 @@ appending a #t at the end."))))))
(if empty
(mkdir dest)
(if recursive
- #f
+ (letrec ((loop (lambda (contents)
+ (when (not (null? contents))
+ (copy
+ (string-append src "/" (car contents))
+ (string-append dest "/" (car contents))
+ recursive)
+ (loop (cdr contents))))))
+ (mkdir dest)
+ (loop contents))
(throw 'f.scm "Can't copy: directory not empty. Try with making the call recursive
by appending a #t at the end."))))
(copy-file src dest)))