mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
feat(vim.fs): find(), dir() can "follow" symlinks #31551
Problem: vim.fs.dir(), vim.fs.find() do not follow symlinks. Solution: - Add "follow" flag. - Enable it by default.
This commit is contained in:
@ -388,15 +388,18 @@ end
|
||||
|
||||
local sysname = uv.os_uname().sysname:lower()
|
||||
|
||||
--- @param s 'win'|'mac'|'freebsd'|'openbsd'|'bsd'
|
||||
--- @param s 'win'|'mac'|'linux'|'freebsd'|'openbsd'|'bsd'
|
||||
--- @return boolean
|
||||
function M.is_os(s)
|
||||
if not (s == 'win' or s == 'mac' or s == 'freebsd' or s == 'openbsd' or s == 'bsd') then
|
||||
if
|
||||
not (s == 'win' or s == 'mac' or s == 'linux' or s == 'freebsd' or s == 'openbsd' or s == 'bsd')
|
||||
then
|
||||
error('unknown platform: ' .. tostring(s))
|
||||
end
|
||||
return not not (
|
||||
(s == 'win' and (sysname:find('windows') or sysname:find('mingw')))
|
||||
or (s == 'mac' and sysname == 'darwin')
|
||||
or (s == 'linux' and sysname == 'linux')
|
||||
or (s == 'freebsd' and sysname == 'freebsd')
|
||||
or (s == 'openbsd' and sysname == 'openbsd')
|
||||
or (s == 'bsd' and sysname:find('bsd'))
|
||||
|
Reference in New Issue
Block a user