diff options
author | Tom Willemsen | 2012-09-16 15:54:56 +0200 |
---|---|---|
committer | Tom Willemsen | 2012-09-16 15:54:56 +0200 |
commit | 3b8eba0f0a1832e159943f8cfe5aad770a60575e (patch) | |
tree | 814d95d52a8e211b1809cf882a17b1ffbac7e592 | |
parent | f9ec43653b237392c9aad0de2c4158ce97eac192 (diff) | |
download | tekuti-3b8eba0f0a1832e159943f8cfe5aad770a60575e.tar.gz tekuti-3b8eba0f0a1832e159943f8cfe5aad770a60575e.zip |
Rename and generalize gitless
Now called `remove-suffix', which removes the given suffix from the
given string.
-rw-r--r-- | tekuti/projects.scm | 10 |
1 files 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/" |