Skip to content

Commit a534358

Browse files
committed
Traverse tmpdir under chdir
1 parent 777daae commit a534358

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tool/lib/_tmpdir.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,13 @@ def list_tree(parent, indent = "", &block)
8282
end
8383
end.new(colorize)
8484
warn colorize.notice("Children under ")+colorize.fail(tmpdir)+":"
85-
ls.list_tree(tmpdir) do |path, st|
86-
if st.directory?
87-
Dir.rmdir(path)
88-
else
89-
File.unlink(path)
85+
Dir.chdir(tmpdir) do
86+
ls.list_tree(".") do |path, st|
87+
if st.directory?
88+
Dir.rmdir(path)
89+
else
90+
File.unlink(path)
91+
end
9092
end
9193
end
9294
require "fileutils"

0 commit comments

Comments
 (0)