added a create? argument to get-dest-directory
svn: r10105 original commit: 24d6e488ce92fb2adb6b73b28eeba8c9329ca19e
This commit is contained in:
parent
13cda846d0
commit
320b104514
|
@ -18,7 +18,10 @@
|
|||
[refer-to-existing-files #f]
|
||||
[root-path #f])
|
||||
|
||||
(define/public (get-dest-directory) dest-dir)
|
||||
(define/public (get-dest-directory [create? #f])
|
||||
(when (and dest-dir create? (not (directory-exists? dest-dir)))
|
||||
(make-directory* dest-dir))
|
||||
dest-dir)
|
||||
|
||||
(define/public (get-substitutions) null)
|
||||
|
||||
|
@ -402,7 +405,7 @@
|
|||
(string->path fn)
|
||||
fn)
|
||||
(let ([src-dir (path-only fn)]
|
||||
[dest-dir (get-dest-directory)]
|
||||
[dest-dir (get-dest-directory #t)]
|
||||
[fn (file-name-from-path fn)])
|
||||
(let ([src-file (build-path (or src-dir (current-directory)) fn)]
|
||||
[dest-file (build-path (or dest-dir (current-directory)) fn)])
|
||||
|
@ -421,7 +424,6 @@
|
|||
(and (equal? s d)
|
||||
(or (eof-object? s) (loop)))))))))))
|
||||
(when (file-exists? dest-file) (delete-file dest-file))
|
||||
(make-directory* (path-only dest-file))
|
||||
(copy-file src-file dest-file))
|
||||
(path->string fn)))))
|
||||
|
||||
|
|
|
@ -998,11 +998,15 @@
|
|||
|
||||
(define/override (get-suffix) #"")
|
||||
|
||||
(define/override (get-dest-directory)
|
||||
(define/override (get-dest-directory [create? #f])
|
||||
(or (and (current-subdirectory)
|
||||
(build-path (or (super get-dest-directory) (current-directory))
|
||||
(current-subdirectory)))
|
||||
(super get-dest-directory)))
|
||||
(let ([d (build-path (or (super get-dest-directory)
|
||||
(current-directory))
|
||||
(current-subdirectory))])
|
||||
(when (and create? (not (directory-exists? d)))
|
||||
(make-directory* d))
|
||||
d))
|
||||
(super get-dest-directory create?)))
|
||||
|
||||
(define/override (derive-filename d)
|
||||
(let ([fn (format "~a.html"
|
||||
|
|
Loading…
Reference in New Issue
Block a user