1
1
mirror of https://git.shadowkat.net/izaya/OC-PsychOS2.git synced 2024-11-14 00:47:00 -05:00

made fs.lua support relative paths

This commit is contained in:
XeonSquared 2019-01-02 16:40:55 +11:00
parent 2f48091a07
commit 7615cf67dc

View File

@ -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] .. "/"