fix file.remove_ext

This commit is contained in:
MihailRis 2026-09-20 22:01:18 +03:00
parent 60f184ae43
commit b9b17358a1
2 changed files with 6 additions and 1 deletions

View file

@ -24,7 +24,11 @@ function file.parent(path)
end
function file.remove_ext(path)
return string.format("%s/%s", file.parent(path), file.stem(path))
local ext = file.ext(path)
if not ext then
return path
end
return path:sub(1, -#ext - 2)
end
function file.path(path)