Skip to content

Commit

Permalink
tl build: project:find() now correctly returns the current dir
Browse files Browse the repository at this point in the history
  • Loading branch information
euclidianAce committed Jul 15, 2020
1 parent 9549e7a commit bd4fcbb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion spec/cli/source_dir_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe("-s --source-dir argument", function()
})
end)
it("should die when the given directory doesn't exist", function()
util.run_mock_project(function() end, {
util.run_mock_project(finally, {
dir_name = "no_source_dir_test",
dir_structure = {
["tlconfig.lua"] = [[return {source_dir="src"}]],
Expand Down
1 change: 1 addition & 0 deletions tl
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ function project:files(inc_patt_arr, exc_patt_arr) -- iterate over the files in
return coroutine.wrap(iter), self.dir
end
function project:find(path) -- allow for indexing with paths project:find("foo/bar") -> project.dir.foo.bar
if path == "" then return self.dir end -- empty string is the current dir
local current_dir = self.dir
for dirname in str_split(path, path_separator) do
current_dir = current_dir[dirname]
Expand Down

0 comments on commit bd4fcbb

Please sign in to comment.