Skip to content

Commit

Permalink
Traverse tmpdir under chdir
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Apr 23, 2024
1 parent 777daae commit a534358
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tool/lib/_tmpdir.rb
Expand Up @@ -82,11 +82,13 @@ def list_tree(parent, indent = "", &block)
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"
Expand Down

0 comments on commit a534358

Please sign in to comment.