(repo string, changedFiles []string, changedOnly bool)
| 979 | } |
| 980 | |
| 981 | func errorFactFiles(repo string, changedFiles []string, changedOnly bool) ([]string, error) { |
| 982 | if changedOnly { |
| 983 | var out []string |
| 984 | for _, path := range changedFiles { |
| 985 | path = filepath.ToSlash(path) |
| 986 | if isErrorFactGoFile(path) { |
| 987 | if _, err := vfs.Stat(filepath.Join(repo, filepath.FromSlash(path))); err != nil { |
| 988 | if os.IsNotExist(err) { |
| 989 | continue |
| 990 | } |
| 991 | return nil, err |
| 992 | } |
| 993 | out = append(out, path) |
| 994 | } |
| 995 | } |
| 996 | sort.Strings(out) |
| 997 | return out, nil |
| 998 | } |
| 999 | |
| 1000 | var out []string |
| 1001 | for _, root := range []string{"cmd", "shortcuts"} { |
| 1002 | if err := walkErrorFactFiles(repo, root, &out); err != nil { |
| 1003 | return nil, err |
| 1004 | } |
| 1005 | } |
| 1006 | sort.Strings(out) |
| 1007 | return out, nil |
| 1008 | } |
| 1009 | |
| 1010 | func walkErrorFactFiles(repo, rel string, out *[]string) error { |
| 1011 | entries, err := vfs.ReadDir(filepath.Join(repo, filepath.FromSlash(rel))) |
no test coverage detected