diff options
author | Arun Isaac | 2023-01-23 19:51:17 +0000 |
---|---|---|
committer | Arun Isaac | 2023-01-23 19:55:14 +0000 |
commit | 8fc064c7b07a249fb0e5cd1180d42629bf8dd32f (patch) | |
tree | e2a151f95800295a3e486b3d7c8a2ff3410b9c6f | |
parent | 9e5dffc1f87d5e038f840bdc43e81b74f511bdaf (diff) | |
download | tissue-8fc064c7b07a249fb0e5cd1180d42629bf8dd32f.tar.gz tissue-8fc064c7b07a249fb0e5cd1180d42629bf8dd32f.tar.lz tissue-8fc064c7b07a249fb0e5cd1180d42629bf8dd32f.zip |
bin: Change to temporary clone before indexing.
Indexing might refer to files on the filesystem.
* bin/tissue (pull): Change to temporary clone of repository before
indexing.
-rwxr-xr-x | bin/tissue | 36 |
1 files changed, 19 insertions, 17 deletions
@@ -403,21 +403,23 @@ HOSTNAME." repository))))) (let ((config (load-config))) (parameterize ((%aliases (tissue-configuration-aliases config))) - ;; Index. - (let ((xapian-directory "xapian")) - (index xapian-directory) - (format (current-error-port) - "Indexed latest changes.~%")) - ;; Build website. - (let ((website-directory "website")) - (guard (c (else (format (current-error-port) - "Building website failed.~%") - (raise c))) - (call-with-temporary-directory - (lambda (temporary-output-directory) + (call-with-temporary-directory + (lambda (temporary-repository-clone) + (clone (git-top-level) temporary-repository-clone) + ;; Index. + (mkdir "xapian") + (let ((xapian-directory (canonicalize-path "xapian"))) + (call-with-current-directory temporary-repository-clone + (cut index xapian-directory)) + (format (current-error-port) + "Indexed latest changes.~%")) + ;; Build website. + (let ((website-directory "website")) + (guard (c (else (format (current-error-port) + "Building website failed.~%") + (raise c))) (call-with-temporary-directory - (lambda (temporary-repository-clone) - (clone (git-top-level) temporary-repository-clone) + (lambda (temporary-output-directory) (call-with-current-directory temporary-repository-clone (cut build-website temporary-output-directory @@ -425,9 +427,9 @@ HOSTNAME." (delete-file-recursively website-directory) (rename-file temporary-output-directory website-directory))) - (chmod website-directory #o755)))) - (format (current-error-port) - "Built website.~%"))))))))))) + (chmod website-directory #o755) + (format (current-error-port) + "Built website.~%")))))))))))))) (define tissue-pull (match-lambda* |