Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(queries): use absolute path #26

Merged
merged 3 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
type-check = pre-commit-hooks.lib.${system}.run {
src = self;
hooks = {
lua-ls.enable = true;
};
settings = {
lua-ls.config = luarc;
lua-ls = {
enable = true;
settings.configuration = luarc;
};
};
};

Expand Down
8 changes: 7 additions & 1 deletion src/luarocks/build/treesitter-parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,16 @@ function treesitter_parser.run(rockspec, no_install)
pcall(fs.delete, "queries")
end
fs.make_dir("queries")
if not fs.exists("queries") then
return nil, "Could not create directory: queries"
end
local queries_dir = dir.path("queries", build.lang)
fs.make_dir(queries_dir)
if not fs.exists(queries_dir) then
return nil, "Could not create directory: " .. queries_dir
end
for name, content in pairs(build.queries) do
local queries_file = dir.path(queries_dir, name)
local queries_file = fs.absolute_name(dir.path(queries_dir, name))
local fd = io.open(queries_file, "w+")
if not fd then
return nil, "Could not open " .. queries_file .. " for writing"
Expand Down
Loading