From 538531f50350fb7c63b2dd08372c89275a834763 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 18 Jan 2025 04:48:34 -0600 Subject: [PATCH] this is a dumb idea. never do this. fix the repo. --- build.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/build.go b/build.go index 5ccd37c..893d9ba 100644 --- a/build.go +++ b/build.go @@ -206,3 +206,21 @@ func (f *Forge) FindWorkingDirRepo() *gitpb.Repo { basedir = strings.Trim(basedir, "/") return f.FindByGoPath(basedir) } + +// Never do this. this is stupid. fix your repo +// Never try to version & release broken repos +// leave this code here as a reminder to never attempt this +func (f *Forge) forgeIgnoreGoMod(repo *gitpb.Repo) bool { + if !repo.Exists(".forge") { + return false + } + log.Info("custom build instructions") + data, _ := repo.ReadFile(".forge") + log.Info(".forge =", string(data)) + for _, line := range strings.Split(string(data), "\n") { + if strings.Contains(line, "forge:ignore:gomod") { // this is stupid + return true + } + } + return false +}