Make sure the directory exists before chdir

This commit is contained in:
Jack Nagel 2014-09-24 17:40:17 -05:00
parent 0d370bc329
commit 612da7c3b0

View File

@ -104,6 +104,8 @@ def check_for_macgpg2
end
def __check_stray_files(dir, pattern, white_list, message)
return unless Dir.exist?(dir)
files = Dir.chdir(dir) {
Dir[pattern].select { |f| File.file?(f) && !File.symlink?(f) }
}