summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/workspace/workspace.lua12
1 files changed, 4 insertions, 8 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua
index 3890044e..ad306beb 100644
--- a/script/workspace/workspace.lua
+++ b/script/workspace/workspace.lua
@@ -307,13 +307,11 @@ function m.awaitPreload(scp)
if scp.uri and not scp:get('bad root') then
log.info('Scan files at:', scp:getName())
- ---@async
scp:gc(fw.watch(m.normalize(furi.decode(scp.uri)), true, function (path)
- local uri = furi.encode(path)
- if m.isIgnored(uri) and not files.isLibrary(uri) then
+ local rpath = m.getRelativePath(path)
+ if native(rpath) then
return false
end
- await.delay()
return true
end))
local count = 0
@@ -333,13 +331,11 @@ function m.awaitPreload(scp)
for _, libMatcher in ipairs(librarys) do
log.info('Scan library at:', libMatcher.uri)
local count = 0
- ---@async
scp:gc(fw.watch(furi.decode(libMatcher.uri), true, function (path)
- local uri = furi.encode(path)
- if m.isIgnored(uri) and not files.isLibrary(uri) then
+ local rpath = m.getRelativePath(path)
+ if libMatcher.matcher(rpath) then
return false
end
- await.delay()
return true
end))
scp:addLink(libMatcher.uri)