Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
gaymeowing committed Aug 9, 2024
1 parent 7781834 commit 840db21
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/depgraph.luau
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ local function FIND_LIB_IN_RELATIVE_PATH(path: string): string?
local fixed_path = if MATCH(path, "/init$") then SUB(path, 1, #path - 5) else path
local found_lib = MATCH(fixed_path, "([^/]+)$")

warn(fixed_path, found_lib)
return if found_lib and GRAPH[found_lib] then
found_lib
else
Expand All @@ -32,8 +33,9 @@ local function find_deps(lib: string, dir: string, dependencies_tbl: { string })
local contents = fs.readFile(entry_path)

for require_path in GMATCH(contents, REQUIRE_PATTERN) do
print(require_path)
local deplib = FIND_LIB_IN_RELATIVE_PATH(require_path)

if deplib and not table.find(dependencies_tbl, deplib) then
table.insert(dependencies_tbl, deplib)
end
Expand Down Expand Up @@ -61,5 +63,5 @@ print(table.find(GRAPH["playerzone"], "character"))
print(table.find(GRAPH["Grouper"], "connector"))
print(table.find(GRAPH["connector"], "cross"))
print(table.find(GRAPH["Retryer"], "cross"))
print(table.find(GRAPH["Race"], "cross"))
print(table.find(GRAPH["race"], "cross"))
return table.freeze(GRAPH)

0 comments on commit 840db21

Please sign in to comment.