Skip to content

Commit

Permalink
fix(trash): mac error deleting dangling symbolic links to trash (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Jan 7, 2024
1 parent a128e6f commit 49b2b3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/oil/adapters/trash/mac.lua
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,14 @@ M.delete_to_trash = function(path, cb)
local basename = vim.fs.basename(path)
local trash_dir = get_trash_dir()
local dest = fs.join(trash_dir, basename)
uv.fs_stat(
uv.fs_lstat(
path,
vim.schedule_wrap(function(stat_err, src_stat)
if stat_err then
return cb(stat_err)
end
assert(src_stat)
if uv.fs_stat(dest) then
if uv.fs_lstat(dest) then
local date_str = vim.fn.strftime(" %Y-%m-%dT%H:%M:%S")
local name_pieces = vim.split(basename, ".", { plain = true })
if #name_pieces > 1 then
Expand Down

0 comments on commit 49b2b3f

Please sign in to comment.