diff --git a/flake.nix b/flake.nix index f7d7750..d4153e5 100644 --- a/flake.nix +++ b/flake.nix @@ -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; + }; }; }; diff --git a/src/luarocks/build/treesitter-parser.lua b/src/luarocks/build/treesitter-parser.lua index 7d91a6f..52a4375 100644 --- a/src/luarocks/build/treesitter-parser.lua +++ b/src/luarocks/build/treesitter-parser.lua @@ -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"