initial public release

This commit is contained in:
2026-07-06 11:05:50 -04:00
commit ca518c5f8a
94 changed files with 15699 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
package tui
import (
"os"
"path/filepath"
)
// findRepoRoot walks up from the executable's location (then cwd) looking for
// internal/scan/adapters.yaml. Returns "." as fallback so the error surfaces
// through LoadConfig rather than here.
func findRepoRoot() string {
candidates := []string{}
if exe, err := os.Executable(); err == nil {
candidates = append(candidates, filepath.Dir(exe), filepath.Dir(filepath.Dir(exe)))
}
if wd, err := os.Getwd(); err == nil {
candidates = append(candidates, wd)
}
for _, start := range candidates {
d := start
for i := 0; i < 6; i++ {
if _, err := os.Stat(filepath.Join(d, "internal", "scan", "adapters.yaml")); err == nil {
return d
}
parent := filepath.Dir(d)
if parent == d {
break
}
d = parent
}
}
return "."
}