fix: fs create on windows

This commit is contained in:
kiyan
2021-09-04 11:08:02 +02:00
parent 425f5eedc7
commit 71122d7984

View File

@@ -77,7 +77,12 @@ function M.create(node)
local num_entries = get_num_entries(utils.path_split(utils.path_remove_trailing(ans))) local num_entries = get_num_entries(utils.path_split(utils.path_remove_trailing(ans)))
for path in utils.path_split(ans) do for path in utils.path_split(ans) do
idx = idx + 1 idx = idx + 1
path_to_create = utils.path_join({path_to_create, path}) local p = utils.path_remove_trailing(path)
if #path_to_create == 0 and vim.fn.has('win32') == 1 then
path_to_create = utils.path_join({p, path_to_create})
else
path_to_create = utils.path_join({path_to_create, p})
end
if is_last_path_file and idx == num_entries then if is_last_path_file and idx == num_entries then
create_file(path_to_create) create_file(path_to_create)
elseif not luv.fs_access(path_to_create, "r") then elseif not luv.fs_access(path_to_create, "r") then