From db64dfb68f0edb1d845f58c38b6e071af2f4f0ae Mon Sep 17 00:00:00 2001 From: pho4cexa Date: Wed, 1 Feb 2023 17:09:45 -0800 Subject: [PATCH] quote source-file so it doesn't break when it has spaces in. tidy issues. --- ISSUES/0002.txt | 3 --- ISSUES/0003 | 3 --- ...to ISSUES :doc => don't link to empty issues} | 0 ...d categorize issues with tags and timestamps} | 0 main.scm | 16 ++++++++++------ 5 files changed, 10 insertions(+), 12 deletions(-) delete mode 100644 ISSUES/0002.txt delete mode 100644 ISSUES/0003 rename ISSUES/{move all TODOs into ISSUES :doc => don't link to empty issues} (100%) rename ISSUES/{use post-update rather than post-receive hook => sort and categorize issues with tags and timestamps} (100%) diff --git a/ISSUES/0002.txt b/ISSUES/0002.txt deleted file mode 100644 index 79a2c0f..0000000 --- a/ISSUES/0002.txt +++ /dev/null @@ -1,3 +0,0 @@ -A plain text file issue - -with a short description diff --git a/ISSUES/0003 b/ISSUES/0003 deleted file mode 100644 index 6239067..0000000 --- a/ISSUES/0003 +++ /dev/null @@ -1,3 +0,0 @@ -Another plain text file issue with no extension - -and a short description diff --git a/ISSUES/move all TODOs into ISSUES :doc b/ISSUES/don't link to empty issues similarity index 100% rename from ISSUES/move all TODOs into ISSUES :doc rename to ISSUES/don't link to empty issues diff --git a/ISSUES/use post-update rather than post-receive hook b/ISSUES/sort and categorize issues with tags and timestamps similarity index 100% rename from ISSUES/use post-update rather than post-receive hook rename to ISSUES/sort and categorize issues with tags and timestamps diff --git a/main.scm b/main.scm index ca48df1..0e309dc 100755 --- a/main.scm +++ b/main.scm @@ -190,7 +190,7 @@ (not (equal? "-\t-\t" (call-with-input-pipe - (string-append "git diff 4b825dc642cb6eb9a060e54bf8d69288fbee4904 --numstat HEAD -- " source-file) + (string-append "git diff 4b825dc642cb6eb9a060e54bf8d69288fbee4904 --numstat HEAD -- " (qs source-file)) (cute read-line <> 4))))) (define (git-repository->paths-list) @@ -198,7 +198,9 @@ (define (git-file->string source-file) (-> - (format "git show HEAD:~a" source-file) + source-file + (qs) + ((flip format) "git show HEAD:~a") (call-with-input-pipe read-lines) (string-intersperse "\n"))) @@ -281,9 +283,11 @@ (string-prefix? "ISSUES/" source-file) `(li (a (@ (href ,source-file)) ,(-> - source-file - ((flip format) "git show HEAD:~a") + (string-append "HEAD:" source-file) + (qs) + ((flip format) "git show ~a") (call-with-input-pipe read-line) + ((lambda (x) (if (eof-object? x) (pathname-strip-directory source-file) x))) (string-trim (string->char-set "# "))))))) source-files-list))))) @@ -394,8 +398,8 @@ (case (string->symbol (or (pathname-extension source-file) "")) ((jpg jpeg png gif webp webm svg apng avif svgz ico) (system (format "git show HEAD:~a > ~a" - source-file - (make-pathname html-path source-file)))))) + (qs source-file) + (make-pathname html-path (qs source-file))))))) source-files-list) ;; if README.md, README, or README.txt exists, regenerate it as index.html. ;; otherwise regenerate files.html as index.html.