mirror of
https://git.shadowkat.net/izaya/OC-PsychOS2.git
synced 2024-11-22 03:54:20 -05:00
made fs.lua support relative paths
This commit is contained in:
parent
2f48091a07
commit
7615cf67dc
@ -10,6 +10,8 @@ function fs.segments(path)
|
||||
return segments
|
||||
end
|
||||
function fs.resolve(path)
|
||||
if not path or path == "." then path = os.getenv("PWD") end
|
||||
if path:sub(1,1) ~= "/" then path=(os.getenv("PWD") or "").."/"..path end
|
||||
local segments, rpath = fs.segments(path), "/"
|
||||
for i = 2, #segments do
|
||||
rpath = rpath .. segments[i] .. "/"
|
||||
|
Loading…
Reference in New Issue
Block a user