in cmd/release/minor/projects/projects.go [122:133]
func getFileCount(releaseBranch string) (int, error) {
pathPattern := filepath.Join(projects.GetProjectPathRoot(), "*", "*", releaseBranch, "*")
out, err := exec.Command("bash", "-c", fmt.Sprintf("find %s -type f | wc -l", pathPattern)).Output()
if err != nil {
return -1, fmt.Errorf("getting file count for %s: %w", releaseBranch, err)
}
count, err := strconv.Atoi(strings.TrimSpace(string(out)))
if err != nil {
return -1, fmt.Errorf("converting file count %v to int: %w", out, err)
}
return count, nil
}