From 12b3d8158b807609f3f571cbf0603bb067878e9b Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Wed, 7 Aug 2024 17:51:44 +0300 Subject: Use kebab case for Variables. --- web/view/markdown.scm | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'web/view/markdown.scm') diff --git a/web/view/markdown.scm b/web/view/markdown.scm index 59eb8b8..e6d595d 100644 --- a/web/view/markdown.scm +++ b/web/view/markdown.scm @@ -56,15 +56,15 @@ (br) (br)))) -(define (fetch-file repo query_path) - (let* ( (abs_path (string-append repo "/" query_path))) - (if (file-exists? abs_path) (let* ((full_path (canonicalize-path abs_path)) - (content (call-with-input-file full_path get-string-all)) +(define (fetch-file repo query-path) + (let* ( (abs-path (string-append repo "/" query-path))) + (if (file-exists? abs-path) (let* ((full-path (canonicalize-path abs-path)) + (content (call-with-input-file full-path get-string-all)) (commit-sha (get-latest-commit-sha1 repo))) - `(("file_path" . ,query_path) + `(("file_path" . ,query-path) ("content" . ,content) ("hash" . ,commit-sha)) - ) (throw 'file-error (string-append "the file path " abs_path " does not exists"))))) + ) (throw 'file-error (string-append "the file path " abs-path " does not exists"))))) (define (git-invoke repo-path . args) (apply system* "git" "-C" repo-path args)) @@ -80,10 +80,9 @@ commit-sha)) (define* (commit-file repo file-path content commit-message username email #:optional (prev-commit "")) - (if (string=? prev-commit (get-latest-commit-sha1 repo)) - #t - (throw 'system-error (format #f "Commits do no match.Please pull in latest changes for current * ~a * and prev * ~a * " - (get-latest-commit-sha1 repo) prev-commit))) + (unless (string=? prev-commit (get-latest-commit-sha1 repo)) + (throw 'system-error (format #f "Commits do no match.Please pull in latest changes for current * ~a * and prev * ~a * " + (get-latest-commit-sha1 repo) prev-commit))) (if (is-repo? repo) (match (file-exists? (string-append repo "/" file-path)) (#t -- cgit v1.2.3