aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2022-02-16 18:19:31 -0300
committerHisham Muhammad <hisham@gobolinux.org>2022-02-17 02:16:50 -0300
commit9ea5e401e8c9ca71dfcf6298e8d7c8ec0f529fa2 (patch)
treedbefbeb370ab59a551ae82e7249fc72fd68a4f93 /src
parent7b61fda916ed40589896e067127e9c6c35730b07 (diff)
downloadluarocks-9ea5e401e8c9ca71dfcf6298e8d7c8ec0f529fa2.tar.gz
luarocks-9ea5e401e8c9ca71dfcf6298e8d7c8ec0f529fa2.tar.bz2
luarocks-9ea5e401e8c9ca71dfcf6298e8d7c8ec0f529fa2.zip
win32.tools: replicate rmdir -p
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/fs/win32/tools.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/luarocks/fs/win32/tools.lua b/src/luarocks/fs/win32/tools.lua
index 80f07866..b8892b83 100644
--- a/src/luarocks/fs/win32/tools.lua
+++ b/src/luarocks/fs/win32/tools.lua
@@ -58,7 +58,15 @@ end
58-- @param directory string: pathname of directory to remove. 58-- @param directory string: pathname of directory to remove.
59function tools.remove_dir_tree_if_empty(directory) 59function tools.remove_dir_tree_if_empty(directory)
60 assert(directory) 60 assert(directory)
61 fs.execute_quiet(vars.RMDIR, directory) 61 while true do
62 fs.execute_quiet(vars.RMDIR, directory)
63 local parent = dir.dir_name(directory)
64 if parent ~= directory then
65 directory = parent
66 else
67 break
68 end
69 end
62end 70end
63 71
64--- Copy a file. 72--- Copy a file.