Skip to content

Commit

Permalink
Cache destination dir.
Browse files Browse the repository at this point in the history
It is not necessary to strip the `destdir` prefix every iteration, when
it can be done just once.
  • Loading branch information
voxik authored and nobu committed Feb 26, 2020
1 parent b8a8fdb commit 9d6d531
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tool/rbinstall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,10 @@ def extract_files(destination_dir, pattern = "*")
return if @src_dir == destination_dir
File.chmod(0700, destination_dir)
mode = pattern == File.join(spec.bindir, '*') ? prog_mode : data_mode
destdir = without_destdir(destination_dir)
spec.files.each do |f|
src = File.join(@src_dir, f)
dest = File.join(without_destdir(destination_dir), f)
dest = File.join(destdir, f)
makedirs(dest[/.*(?=\/)/m])
install src, dest, :mode => mode
end
Expand Down

0 comments on commit 9d6d531

Please sign in to comment.