mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-06-18 22:23:07 -03:00
patch IsDotFile function compatible with both '.' and '..'
Signed-off-by: Huitse Tai <geb.1989@gmail.com>
This commit is contained in:
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.
|
||||
|
Reference in New Issue
Block a user