Skip to content

Commit

Permalink
add error message to linelist
Browse files Browse the repository at this point in the history
  • Loading branch information
drizk1 committed Sep 5, 2024
1 parent 5a23401 commit c9c1949
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/TidierFiles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,12 @@ function list_files(path = "", pattern = "")
files = map(walkdir(path)) do (root, dirs, files)
joinpath.(root, files)
end
files = reduce(vcat, files)
files = filter(x -> occursin(pattern, x), files)
if isempty(files)
error("No files ending with $pattern located at $path")
else
files = reduce(vcat, files)
files = filter(x -> occursin(pattern, x), files)
end
return files
end

Expand Down

0 comments on commit c9c1949

Please sign in to comment.