From 3b8eba0f0a1832e159943f8cfe5aad770a60575e Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 16 Sep 2012 15:54:56 +0200 Subject: Rename and generalize gitless Now called `remove-suffix', which removes the given suffix from the given string. --- tekuti/projects.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tekuti/projects.scm b/tekuti/projects.scm index 1f5fcf2..db5e7a2 100644 --- a/tekuti/projects.scm +++ b/tekuti/projects.scm @@ -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/" -- cgit v1.2.3-54-g00ecf