Avoid crashing when msftidy'ing missing files

bug/bundler_fix
William Vu 2013-11-20 16:36:07 -06:00
parent 110e78a1ad
commit b75f5a8f45
1 changed files with 9 additions and 5 deletions

View File

@ -481,10 +481,14 @@ if dirs.length < 1
end
dirs.each do |dir|
Find.find(dir) do |full_filepath|
next if full_filepath =~ /\.git[\x5c\x2f]/
next unless File.file? full_filepath
next unless full_filepath =~ /\.rb$/
run_checks(full_filepath)
begin
Find.find(dir) do |full_filepath|
next if full_filepath =~ /\.git[\x5c\x2f]/
next unless File.file? full_filepath
next unless full_filepath =~ /\.rb$/
run_checks(full_filepath)
end
rescue Errno::ENOENT
$stderr.puts "#{File.basename(__FILE__)}: #{dir}: No such file or directory"
end
end