From 8a0ebe220af6aa7e7138def83b7cd2ebbc8418b2 Mon Sep 17 00:00:00 2001 From: Marco Andronaco Date: Fri, 5 Jul 2024 16:32:34 +0000 Subject: git: hide .git extension --- routes/util.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'routes/util.go') diff --git a/routes/util.go b/routes/util.go index 1b31b17..27c26ce 100644 --- a/routes/util.go +++ b/routes/util.go @@ -16,6 +16,14 @@ func isGoModule(gr *git.GitRepo) bool { return err == nil } +func getDisplayName(name string) string { + l := len(name) - 4 + if name[l:] == ".git" { + name = name[:l] + } + return name +} + func getDescription(path string) (desc string) { db, err := os.ReadFile(filepath.Join(path, "description")) if err == nil { -- cgit v1.2.3