mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add file.parent(...)
This commit is contained in:
parent
567105dfce
commit
c6492b3d25
1 changed files with 8 additions and 0 deletions
|
|
@ -543,3 +543,11 @@ end
|
|||
function file.prefix(path)
|
||||
return path:match("^([^:]+)")
|
||||
end
|
||||
|
||||
function file.parent(path)
|
||||
local pos = path:find("/")
|
||||
if not pos then
|
||||
return file.prefix(path)..":"
|
||||
end
|
||||
return path:sub(0, pos-1)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue