Skip to content

Commit

Permalink
fix(darwin): parsers installed with debug symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Aug 19, 2024
1 parent 5e78c4e commit acaa30f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/luarocks/build/treesitter-parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Note: tree-sitter 0.22.2 or later is required to build this parser.
end
pcall(function()
local dsym_file = dir.absolute_name(dir.path(parser_dir, parser_lib .. ".dSYM"))
if fs.exists(dsym_file) then
if fs.exists(dsym_file) or fs.is_dir(dsym_file) then
-- Try to remove macos debug symbols if they exist
fs.delete(dsym_file)
end
Expand All @@ -141,7 +141,11 @@ Note: tree-sitter 0.22.2 or later is required to build this parser.
-- For neovim plugin managers that do not symlink parser_dir to the rtp
local dest = dir.path(path.install_dir(rockspec.name, rockspec.version), "parser")
fs.make_dir(dest)
ok, err = fs.copy_contents(parser_dir, dest)
for _, src in pairs(fs.list_dir(parser_dir)) do
if src:find("%.so$") ~= nil then
fs.copy(dir.path(parser_dir, src), dest)
end
end
end
return ok, err
end
Expand Down

0 comments on commit acaa30f

Please sign in to comment.