mirror of
https://github.com/junegunn/fzf.git
synced 2026-09-04 22:07:03 +08:00
Make symlinks to directories to return as directories, not files (#4676)
Fix #4675
This commit is contained in:
+6
-2
@@ -303,8 +303,12 @@ func (r *Reader) readFiles(roots []string, opts walkerOpts, ignores []string) bo
|
|||||||
}
|
}
|
||||||
path = trimPath(path)
|
path = trimPath(path)
|
||||||
if path != "." {
|
if path != "." {
|
||||||
isDir := de.IsDir()
|
isDirSymlink := isSymlinkToDir(path, de)
|
||||||
if isDir || opts.follow && isSymlinkToDir(path, de) {
|
if isDirSymlink && !opts.follow {
|
||||||
|
return filepath.SkipDir
|
||||||
|
}
|
||||||
|
isDir := de.IsDir() || isDirSymlink
|
||||||
|
if isDir {
|
||||||
base := filepath.Base(path)
|
base := filepath.Base(path)
|
||||||
if !opts.hidden && base[0] == '.' && base != ".." {
|
if !opts.hidden && base[0] == '.' && base != ".." {
|
||||||
return filepath.SkipDir
|
return filepath.SkipDir
|
||||||
|
|||||||
Reference in New Issue
Block a user