From a53435868e09fd1b149def652f356840f58f4d32 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 23 Apr 2024 13:09:51 +0900 Subject: [PATCH] Traverse tmpdir under chdir --- tool/lib/_tmpdir.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tool/lib/_tmpdir.rb b/tool/lib/_tmpdir.rb index 52baa6e00b..fd429dab37 100644 --- a/tool/lib/_tmpdir.rb +++ b/tool/lib/_tmpdir.rb @@ -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"