diff options
author | Marco Andronaco <andronacomarco@gmail.com> | 2024-07-05 16:32:34 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-05 22:02:34 +0530 |
commit | 8a0ebe220af6aa7e7138def83b7cd2ebbc8418b2 (patch) | |
tree | c329f1ae18eac56ca2df6daeaaef39d9c9e8695b /routes/util.go | |
parent | templates: Add link to tar gz handler endpoint (diff) | |
download | legitrx-8a0ebe220af6aa7e7138def83b7cd2ebbc8418b2.tar.gz legitrx-8a0ebe220af6aa7e7138def83b7cd2ebbc8418b2.tar.zst legitrx-8a0ebe220af6aa7e7138def83b7cd2ebbc8418b2.zip |
git: hide .git extension
Diffstat (limited to 'routes/util.go')
-rw-r--r-- | routes/util.go | 8 |
1 files changed, 8 insertions, 0 deletions
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 { |