mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 07:13:45 +01:00
Add file.get_name
This commit is contained in:
parent
c0ea0dba47
commit
dc80e8b45c
4
file.lua
4
file.lua
@ -5,6 +5,10 @@ local io, minetest, modlib, string = io, minetest, modlib, string
|
||||
local _ENV = {}
|
||||
setfenv(1, _ENV)
|
||||
|
||||
function get_name(filepath)
|
||||
assert(#modlib.dir_delim == 1)
|
||||
return filepath:match(modlib.dir_delim .. "?(.-)$")
|
||||
end
|
||||
function get_extension(filename)
|
||||
return filename:match"(.*)%.(.*)$"
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user