Skip to content

Commit

Permalink
Throw error if path does not exist
Browse files Browse the repository at this point in the history
Addresses #9.  This will hopefully avoid any problems that arise in
any internal functions used.  Note that further error handling should
be implemented, as, for example, checking for package or bundle still
seg faults when you give it the root directory.
  • Loading branch information
jakewilliami committed Aug 29, 2022
1 parent ed90fb5 commit 5aa2ad0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/HiddenFiles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ end

# Each OS branch defines its own _ishidden function. In the main ishidden function, we check that the path exists, expand
# the real path out, and apply the branch's _ishidden function to that path to get a final result
ishidden(f::AbstractString) = ispath(f) && _ishidden(realpath(f))
function ishidden(f::AbstractString)
ispath(f) || throw(Base.uv_error("ishidden($(repr(f)))", Base.UV_ENOENT))
return _ishidden(realpath(f))
end


end
Expand Down

0 comments on commit 5aa2ad0

Please sign in to comment.