Skip to content

Commit

Permalink
don't handle ../?.lua for now
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Nov 21, 2024
1 parent db8127a commit 117d3a8
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions script/workspace/require-path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,28 +98,6 @@ function mt:getRequireResultByPath(path)
end
end

-- handle `../?.lua`
local parentCount = 0
for _ = 1, 1000 do
if searcher:match '^%.%.[/\\]' then
parentCount = parentCount + 1
searcher = searcher:sub(4)
else
break
end
end
if parentCount > 0 then
local parentPath = libraryPath
or (self.scp.uri and furi.decode(self.scp.uri))
if parentPath then
local tail
for _ = 1, parentCount do
parentPath, tail = parentPath:match '^(.+)[/\\]([^/\\]*)$'
currentPath = tail .. '/' .. currentPath
end
end
end

repeat
cutedPath = currentPath:sub(pos)
head = currentPath:sub(1, pos - 1)
Expand Down

0 comments on commit 117d3a8

Please sign in to comment.