Skip to content

Commit

Permalink
fix: use fs.current_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Jul 20, 2024
1 parent 33c8809 commit 28053f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/luarocks/build/treesitter-parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ function treesitter_parser.run(rockspec, no_install)
("'%s' is not installed.\n%s requires %s to build."):format(js_runtime, rockspec.name, js_runtime_name)
end
end
local cwd = fs.absolute_name(dir.path("."))
local cwd = fs.current_dir()
if build_root_dir and cwd:match("^" .. build_root_dir) then
-- cwd is a subdirectory of build_root_dir.
util.printout("Changing to directory: " .. build_root_dir)
fs.change_dir(build_root_dir)
end
if build.location then
build_root_dir = fs.absolute_name(dir.path("."))
build_root_dir = fs.current_dir()
util.printout("Changing to directory: " .. build.location)
fs.change_dir(build.location)
end
Expand Down

0 comments on commit 28053f4

Please sign in to comment.