diff options
Diffstat (limited to 'script/workspace/workspace.lua')
-rw-r--r-- | script/workspace/workspace.lua | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index 65b3b1ac..dbe2f346 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -507,16 +507,22 @@ function m.normalize(path) end ---@return string -function m.getAbsolutePath(path) +function m.getAbsolutePath(folderUriOrPath, path) if not path or path == '' then return nil end path = m.normalize(path) if fs.path(path):is_relative() then - if not m.rootPath then + if not folderUriOrPath then return nil end - path = m.normalize(m.rootPath .. '/' .. path) + local folderPath + if folderUriOrPath:sub(1, 5) == 'file:' then + folderPath = furi.decode(folderUriOrPath) + else + folderPath = folderUriOrPath + end + path = m.normalize(folderPath .. '/' .. path) end return path end |