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)))
|
(read-line)))
|
||||||
"Unknown")))
|
"Unknown")))
|
||||||
|
|
||||||
(define (gitless name)
|
(define (remove-suffix str suffix)
|
||||||
(let ((pos (string-contains name ".git")))
|
(let ((pos (string-contains str suffix)))
|
||||||
(if pos
|
(if pos
|
||||||
(substring name 0 pos)
|
(substring str 0 pos)
|
||||||
name)))
|
str)))
|
||||||
|
|
||||||
(define (project->row dir project prefix)
|
(define (project->row dir project prefix)
|
||||||
(let ((project-dir (string-append dir "/" project))
|
(let ((project-dir (string-append dir "/" project))
|
||||||
(project-name (gitless project)))
|
(project-name (remove-suffix project ".git")))
|
||||||
`(tr
|
`(tr
|
||||||
(td (@ (class "span3"))
|
(td (@ (class "span3"))
|
||||||
(a (@ (href "http://code.ryuslash.org/cgit.cgi/"
|
(a (@ (href "http://code.ryuslash.org/cgit.cgi/"
|
||||||
|
|
Loading…
Reference in a new issue