this is a dumb idea. never do this. fix the repo.

This commit is contained in:
Jeff Carr 2025-01-18 04:48:34 -06:00
parent e8f29e593d
commit 538531f503
1 changed files with 18 additions and 0 deletions

View File

@ -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
}