2022-12-22 15:43:49 +00:00
|
|
|
package routes
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
2023-01-31 21:27:48 +00:00
|
|
|
|
|
|
|
"git.icyphox.sh/legit/git"
|
2022-12-22 15:43:49 +00:00
|
|
|
)
|
|
|
|
|
2023-01-31 21:27:48 +00:00
|
|
|
func isGoModule(gr *git.GitRepo) bool {
|
|
|
|
_, err := gr.FileContent("go.mod")
|
|
|
|
return err == nil
|
|
|
|
}
|
|
|
|
|
2022-12-22 15:43:49 +00:00
|
|
|
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
|
|
|
|
}
|