File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,14 +19,11 @@ local mkdir_cache = {}
1919
2020local function make_dir_for (pathname )
2121 local normalized , root = common .normalize (pathname )
22- print (" pathname:" , pathname )
23- print (" normalized to:" , normalized )
24- print (" with root:" , root )
25- if normalized == root then
22+ local dirname = normalized :match (" ^(.*" .. common .sep .. " )[^" .. common .sep .. " ]+$" )
23+
24+ if dirname == root then
2625 return
2726 end
28- local dirname = normalized :match (" ^(.+)" .. common .sep .. " [^" .. common .sep .. " ]+$" )
29- print (" extracted dirname:" , dirname )
3027 if dirname then
3128 if mkdir_cache [dirname ] then
3229 return
Original file line number Diff line number Diff line change @@ -19,14 +19,11 @@ local mkdir_cache = {}
1919
2020local function make_dir_for (pathname: string )
2121 local normalized, root = common.normalize (pathname)
22- print (" pathname:" , pathname)
23- print (" normalized to:" , normalized)
24- print (" with root:" , root)
25- if normalized == root then
22+ local dirname = normalized:match (" ^(.*" .. common.sep .. " )[^" .. common.sep .. " ]+$" )
23+ -- on Windows, root contains the drive letter and looks like `D:\`
24+ if dirname == root then
2625 return
2726 end
28- local dirname = normalized:match (" ^(.+)" .. common.sep .. " [^" .. common.sep .. " ]+$" )
29- print (" extracted dirname:" , dirname)
3027 if dirname then
3128 if mkdir_cache[dirname] then
3229 return
You can’t perform that action at this time.
0 commit comments