summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorArun Isaac2023-01-23 19:51:17 +0000
committerArun Isaac2023-01-23 19:55:14 +0000
commit8fc064c7b07a249fb0e5cd1180d42629bf8dd32f (patch)
treee2a151f95800295a3e486b3d7c8a2ff3410b9c6f /bin
parent9e5dffc1f87d5e038f840bdc43e81b74f511bdaf (diff)
downloadtissue-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.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/tissue36
1 files changed, 19 insertions, 17 deletions
diff --git a/bin/tissue b/bin/tissue
index 3dfc37b..4a2f37d 100755
--- a/bin/tissue
+++ b/bin/tissue
@@ -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*