GetRepositoryRoot returns the absolute path to the repository root
(repoPath string)
| 15 | |
| 16 | // GetRepositoryRoot returns the absolute path to the repository root |
| 17 | func GetRepositoryRoot(repoPath string) (string, error) { |
| 18 | stdout, stderr, err := runGitCommand(repoPath, "rev-parse", "--show-toplevel") |
| 19 | if err != nil { |
| 20 | return "", gitCommandError(err, stderr) |
| 21 | } |
| 22 | |
| 23 | return strings.TrimSpace(string(stdout)), nil |
| 24 | } |
| 25 | |
| 26 | // filterDartFiles filters a list of file paths to include only .dart files |
| 27 | func filterDartFiles(files []string) []string { |