diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-04-23 13:09:51 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-04-23 13:38:40 +0900 |
commit | a53435868e09fd1b149def652f356840f58f4d32 (patch) | |
tree | f257290fd754c42d1932a7adb70eecc04e999b26 /tool/lib | |
parent | 777daae04992fdb472e2382a08aefc9fd2366159 (diff) |
Traverse tmpdir under chdir
Diffstat (limited to 'tool/lib')
-rw-r--r-- | tool/lib/_tmpdir.rb | 12 |
1 files 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" |