all repos — legit @ ee459fce7bc466f0d388f80de6396cfe260967b0

web frontend for git

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}