Skip to content

Commit

Permalink
Check for . and .. for UNIX
Browse files Browse the repository at this point in the history
Even though . and .. directories start with ., they should be excluded
from being hidden

Addresses #1
  • Loading branch information
jakewilliami committed Aug 28, 2022
1 parent e7bd5ce commit 78fe51a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/HiddenFiles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ module HiddenFiles
export ishidden

@static if Sys.isunix()
_ishidden_unix(f::AbstractString) = startswith(basename(f), '.')
const DOT_EXCLUSIONS = (".", "..")
function _ishidden_unix(f::AbstractString)
_basename = basename(f) DOT_EXCLUSIONS
_basename DOT_EXCLUSIONS && return false
return startswith(basename(f), '.')
end

@static if Sys.isapple()
### Hidden Files and Directories: Simplifying the User Experience ###
Expand Down

0 comments on commit 78fe51a

Please sign in to comment.