Skip to content

Commit

Permalink
Merge pull request #62 from elecdeer/fix/recognize_symlink
Browse files Browse the repository at this point in the history
fix: resolve issue with unrecognized symblic links
  • Loading branch information
babarot authored Jan 14, 2025
2 parents 0afb186 + 186f0c4 commit e7e606a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,23 @@ func resolvePath(path string) (string, bool, error) {
return path, false, err
}

if fi.Mode()&os.ModeSymlink == os.ModeSymlink {
path, err = os.Readlink(path)
if err != nil {
return path, false, err
}
fi, err = os.Lstat(path)
if err != nil {
return path, false, err
}
}

isDir := fi.IsDir()

if filepath.IsAbs(path) {
return path, isDir, nil
}

if fi.Mode()&os.ModeSymlink == os.ModeSymlink {
path, err = os.Readlink(path)
}

return path, isDir, err
}

Expand Down

0 comments on commit e7e606a

Please sign in to comment.