mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-05-23 08:30:07 -03:00
patch IsDotFile function compatible with both '.' and '..'
Signed-off-by: Huitse Tai <geb.1989@gmail.com>
This commit is contained in:
parent
887bc6a4be
commit
a786f6175e
3
utils.go
3
utils.go
@ -40,8 +40,9 @@ func IsConfiguration(path string) bool {
|
||||
|
||||
// IsDotFile returns whether or not path has dot as a prefix.
|
||||
func IsDotFile(path string) bool {
|
||||
path = filepath.Clean(path)
|
||||
base := filepath.Base(path)
|
||||
return strings.HasPrefix(base, ".") && len(base) > len(".")
|
||||
return strings.HasPrefix(base, ".") && base != "." && base != ".."
|
||||
}
|
||||
|
||||
// IsVendor returns whether or not path is a vendor path.
|
||||
|
Loading…
x
Reference in New Issue
Block a user