diff options
author | Arun Isaac | 2022-07-04 17:41:09 +0530 |
---|---|---|
committer | Arun Isaac | 2022-07-04 18:22:36 +0530 |
commit | 84e11ed620dec887439060587e277a6fe03c7847 (patch) | |
tree | 1ea08e55682b798017319926f3c42a49297ae95f | |
parent | 9baa47d22625288932a1872528a10d721d509b05 (diff) | |
download | tissue-84e11ed620dec887439060587e277a6fe03c7847.tar.gz tissue-84e11ed620dec887439060587e277a6fe03c7847.tar.lz tissue-84e11ed620dec887439060587e277a6fe03c7847.zip |
web: static: Deprecate mkdir-p in favor of guile-filesystem.
* tissue/web/static.scm: Import (ice-9 filesystem).
(mkdir-p): Delete function.
(build-website): Use make-directories instead of mkdir-p. Remove TODO
note about using guile-filesystem.
-rw-r--r-- | tissue/web/static.scm | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/tissue/web/static.scm b/tissue/web/static.scm index bc759b2..4821fca 100644 --- a/tissue/web/static.scm +++ b/tissue/web/static.scm @@ -25,6 +25,7 @@ #:use-module (srfi srfi-26) #:use-module (srfi srfi-28) #:use-module (srfi srfi-171) + #:use-module (ice-9 filesystem) #:use-module (skribilo engine) #:use-module (skribilo evaluator) #:use-module (skribilo reader) @@ -53,14 +54,6 @@ (name file-name) (writer file-writer)) -(define (mkdir-p directory) - "Create DIRECTORY and all its parents." - (unless (or (string=? directory "/") - (string=? directory ".")) - (mkdir-p (dirname directory))) - (unless (file-exists? directory) - (mkdir directory))) - (define (replace-extension file new-extension) "Return a new filename where the extension of FILE is replaced with NEW-EXTENSION." @@ -116,7 +109,6 @@ original current directory." thunk (cut chdir previous-current-directory)))) -;; TODO: Use guile-filesystem. (define* (build-website repository-top-level output-directory css files) "Export git repository with REPOSITORY-TOP-LEVEL to OUTPUT-DIRECTORY as a website. @@ -134,14 +126,14 @@ the web output." (when css (engine-custom-set! (find-engine 'html) 'css css)) ;; Create output directory. - (mkdir-p output-directory) + (make-directories output-directory) ;; Write each of the <file> objects. (for-each (lambda (file) (let ((output-file (string-append output-directory "/" (file-name file)))) (display output-file (current-error-port)) (newline (current-error-port)) - (mkdir-p (dirname output-file)) + (make-directories (dirname output-file)) (call-with-output-file output-file (lambda (port) (with-current-directory repository-top-level |