aboutsummaryrefslogtreecommitdiff
path: root/web/view/markdown.scm
diff options
context:
space:
mode:
Diffstat (limited to 'web/view/markdown.scm')
-rw-r--r--web/view/markdown.scm16
1 files changed, 8 insertions, 8 deletions
diff --git a/web/view/markdown.scm b/web/view/markdown.scm
index 5f3474c..fd8838f 100644
--- a/web/view/markdown.scm
+++ b/web/view/markdown.scm
@@ -20,8 +20,8 @@
markdown-github->sxml
fetch-file
fetch-raw-file
- commit-file
- is-repo?))
+ commit-file))
+
(define (markdown-file->sxml fn)
"Parse a local file"
@@ -57,14 +57,14 @@
(br))))
(define (fetch-file repo query-path)
- (let* ( (abs-path (string-append repo "/" query-path)))
+ (let* ( (abs-path (format #f "~a/~a" 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)
("content" . ,content)
("hash" . ,commit-sha))
- ) (throw 'file-error (string-append "the file path " abs-path " does not exists")))))
+ ) (throw 'file-error (format #f "~a does not exists" abs-path)))))
(define (git-invoke repo-path . args)
(apply system* "git" "-C" repo-path args))
@@ -84,9 +84,9 @@
(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 (git-repository? repo)
- (match (file-exists? (string-append repo "/" file-path))
+ (match (file-exists? (format #f "~a/~a" repo file-path))
(#t
- (with-output-to-file (string-append repo "/" file-path)
+ (with-output-to-file (format #f "~a/~a" repo file-path)
(lambda ()
(display content)))
(let* ((git-add-file (git-invoke repo "add" file-path))
@@ -100,5 +100,5 @@
`(("status" . "201") ("message" . "committed file successfully") ("content" . ,content) ("commit_sha" . ,git-commit-sha) ("commit_message" . ,commit-message) )
`(("status" . "200") ("message" . "Nothing to commit, working tree clean") ("commit_sha" . ,git-commit-sha)))))
(#f
- (throw 'system-error (string-append file-path " File does not exist Error"))))
- (throw 'system-error (string-append repo " Is not a git repo."))))
+ (throw 'system-error (format #f "~a File does not exist error" file-path))))
+ (throw 'system-error (format #f "~a is no a git repo" repo))))