Skip to content

Commit

Permalink
fix(darwin): parsers installed with debug symbols (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb authored Aug 19, 2024
1 parent a82fac4 commit 3d5a9e0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/luarocks/build/treesitter-parser-cpp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ function treesitter_parser.run(rockspec, no_install)
ok, err = run(rockspec, no_install)
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 @@ -457,7 +457,11 @@ function treesitter_parser.run(rockspec, no_install)
-- 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 3d5a9e0

Please sign in to comment.