From 42d1fab6654564cf418f669355705b10ee0c9bc2 Mon Sep 17 00:00:00 2001 From: pho4cexa Date: Sun, 4 Dec 2022 18:07:10 -0800 Subject: [PATCH] move common line outside conditional for d.r.y. --- main.scm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main.scm b/main.scm index fe948b7..6faf4b0 100755 --- a/main.scm +++ b/main.scm @@ -155,10 +155,9 @@ string-block (call-with-input-pipe "git shortlog -ns HEAD" read-lines))))))))) (define (generate-repository-directory) - (if (directory-exists? REPOSITORY-DIRECTORY) - (begin (delete-directory REPOSITORY-DIRECTORY #t) - (create-directory REPOSITORY-DIRECTORY #t)) - (create-directory REPOSITORY-DIRECTORY #t))) + (when (directory-exists? REPOSITORY-DIRECTORY) + (delete-directory REPOSITORY-DIRECTORY #t)) + (create-directory REPOSITORY-DIRECTORY #t)) (define (generate-html-files) (let ((source-files-list (git-repository->paths-list)))