mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 14:01:49 +00:00
fix file.ext
This commit is contained in:
parent
db53076c62
commit
60f184ae43
2 changed files with 6 additions and 1 deletions
|
|
@ -1,3 +1,8 @@
|
||||||
|
debug.log("file extension")
|
||||||
|
asserts.equals(nil, file.ext("config:test"))
|
||||||
|
asserts.equals("cfg", file.ext("config:test.cfg"))
|
||||||
|
asserts.equals("gz", file.ext("config:test.cfg.gz"))
|
||||||
|
|
||||||
debug.log("check initial state")
|
debug.log("check initial state")
|
||||||
assert(file.exists("config:"))
|
assert(file.exists("config:"))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ function file.stem(path)
|
||||||
end
|
end
|
||||||
|
|
||||||
function file.ext(path)
|
function file.ext(path)
|
||||||
return path:match("%.([^:/\\]+)$")
|
return path:match("[^:/\\.]%.([^.:/\\]+)$")
|
||||||
end
|
end
|
||||||
|
|
||||||
function file.prefix(path)
|
function file.prefix(path)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue