Traverse tmpdir under chdir

This commit is contained in:
Nobuyoshi Nakada 2024-04-23 13:09:51 +09:00
parent 777daae049
commit a53435868e
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465

View File

@ -82,11 +82,13 @@ END {
end
end.new(colorize)
warn colorize.notice("Children under ")+colorize.fail(tmpdir)+":"
ls.list_tree(tmpdir) do |path, st|
if st.directory?
Dir.rmdir(path)
else
File.unlink(path)
Dir.chdir(tmpdir) do
ls.list_tree(".") do |path, st|
if st.directory?
Dir.rmdir(path)
else
File.unlink(path)
end
end
end
require "fileutils"