commit e02cb4feddb01b6e2d6a637f6e9546b96de51000
parent 3fb4aa0a284fecd5bb4be8ce5b785567de6adaa0
Author: Hugo Soucy <hugo@soucy.cc>
Date: Mon, 3 Apr 2023 11:13:46 -0400
Fix a big bug with the directory creation
Diffstat:
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/satelito/file.lua b/satelito/file.lua
@@ -162,12 +162,8 @@ end
-- Create a dirtree
function file.mkdir(filepath)
local sep, pStr = package.config:sub(1, 1), ''
- -- Check if the filepath is absolute or relative
- local _filepath = (string.find(filepath, lfs.currentdir())
- and filepath
- or lfs.currentdir() .. '/' .. filepath)
+ local _filepath = lfs.currentdir()..file.get_relpath(filepath, lfs.currentdir())
- --
for dir in _filepath:gmatch('[^' .. sep .. ']+') do
pStr = pStr .. sep .. dir
lfs.mkdir(pStr)