aboutsummaryrefslogtreecommitdiff
path: root/hotline/files.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2024-04-12 13:03:28 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2024-04-12 13:07:23 -0700
commit9ff8293362adff9e7c39d9f620b593f6be661f1e (patch)
tree12c2990fcc0c487abd2695934fdd4169e6b44dbe /hotline/files.go
parent5b8da5035083a849d6116672c8701cc9c184a830 (diff)
Fix handling of symlinks in Files dir
Diffstat (limited to 'hotline/files.go')
-rw-r--r--hotline/files.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/hotline/files.go b/hotline/files.go
index 0746b1f..8d35a94 100644
--- a/hotline/files.go
+++ b/hotline/files.go
@@ -50,13 +50,14 @@ func getFileNameList(path string, ignoreList []string) (fields []Field, err erro
return fields, err
}
+ // Check if path is a symlink. If so, follow it.
if fileInfo.Mode()&os.ModeSymlink != 0 {
resolvedPath, err := os.Readlink(filepath.Join(path, file.Name()))
if err != nil {
return fields, err
}
- rFile, err := os.Stat(filepath.Join(path, resolvedPath))
+ rFile, err := os.Stat(resolvedPath)
if errors.Is(err, os.ErrNotExist) {
continue
}