summaryrefslogblamecommitdiffstats
path: root/routes/util.go
blob: e6a6267bac93a34c5bf24ccd6a5fcb43496d0ec9 (plain) (tree)
1
2
3
4
5
6
7
8
9




                       

                                  

 




                                          


















                                                                  
package routes

import (
	"os"
	"path/filepath"

	"git.icyphox.sh/legit/git"
)

func isGoModule(gr *git.GitRepo) bool {
	_, err := gr.FileContent("go.mod")
	return err == nil
}

func getDescription(path string) (desc string) {
	db, err := os.ReadFile(filepath.Join(path, "description"))
	if err == nil {
		desc = string(db)
	} else {
		desc = ""
	}
	return
}

func (d *deps) isIgnored(name string) bool {
	for _, i := range d.c.Repo.Ignore {
		if name == i {
			return true
		}
	}

	return false
}