Rename and generalize gitless
Now called `remove-suffix', which removes the given suffix from the given string.
This commit is contained in:
parent
f9ec43653b
commit
3b8eba0f0a
1 changed files with 5 additions and 5 deletions
|
@ -34,15 +34,15 @@
|
|||
(read-line)))
|
||||
"Unknown")))
|
||||
|
||||
(define (gitless name)
|
||||
(let ((pos (string-contains name ".git")))
|
||||
(define (remove-suffix str suffix)
|
||||
(let ((pos (string-contains str suffix)))
|
||||
(if pos
|
||||
(substring name 0 pos)
|
||||
name)))
|
||||
(substring str 0 pos)
|
||||
str)))
|
||||
|
||||
(define (project->row dir project prefix)
|
||||
(let ((project-dir (string-append dir "/" project))
|
||||
(project-name (gitless project)))
|
||||
(project-name (remove-suffix project ".git")))
|
||||
`(tr
|
||||
(td (@ (class "span3"))
|
||||
(a (@ (href "http://code.ryuslash.org/cgit.cgi/"
|
||||
|
|
Loading…
Reference in a new issue