all repos — legit @ 1e7b63814fc003577e14356c79793cc827661270

web frontend for git, written in go

routes/util.go (view raw)

 1package routes
 2
 3import (
 4	"os"
 5	"path/filepath"
 6
 7	"git.icyphox.sh/legit/git"
 8)
 9
10func isGoModule(gr *git.GitRepo) bool {
11	_, err := gr.FileContent("go.mod")
12	return err == nil
13}
14
15func getDescription(path string) (desc string) {
16	db, err := os.ReadFile(filepath.Join(path, "description"))
17	if err == nil {
18		desc = string(db)
19	} else {
20		desc = ""
21	}
22	return
23}
24
25func (d *deps) isIgnored(name string) bool {
26	for _, i := range d.c.Repo.Ignore {
27		if name == i {
28			return true
29		}
30	}
31
32	return false
33}