diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2022-02-16 18:19:31 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2022-02-17 02:16:50 -0300 |
| commit | 9ea5e401e8c9ca71dfcf6298e8d7c8ec0f529fa2 (patch) | |
| tree | dbefbeb370ab59a551ae82e7249fc72fd68a4f93 /src | |
| parent | 7b61fda916ed40589896e067127e9c6c35730b07 (diff) | |
| download | luarocks-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.lua | 10 |
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. |
| 59 | function tools.remove_dir_tree_if_empty(directory) | 59 | function 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 | ||
| 62 | end | 70 | end |
| 63 | 71 | ||
| 64 | --- Copy a file. | 72 | --- Copy a file. |
