From de046690c01cf90c906ee74b8180d10f17757fb7 Mon Sep 17 00:00:00 2001 From: Derek Stevens Date: Tue, 31 Jan 2023 21:30:40 -0700 Subject: only add go meta import tag if go.mod exists in repo root This is a multipart message in MIME format. Pretty self-explanitory :3 Signed-off-by: Derek Stevens --- routes/util.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'routes/util.go') diff --git a/routes/util.go b/routes/util.go index d3f80fe..e6a6267 100644 --- a/routes/util.go +++ b/routes/util.go @@ -3,8 +3,15 @@ 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 { -- cgit