Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env ruby
raw_input_file_path = ARGV[0]
enhanced_input_file_path = ARGV[1]
enhanced_file_path = Dir.glob(raw_input_file_path)
raw_file_path = Dir.glob(enhanced_input_file_path)
enhanced_files = enhanced_file_path.map {|x| File.basename(x)}
raw_files = raw_file_path.map {|x| File.basename(x)}
enhanced_dir_unique_files = raw_files - enhanced_files
raw_dir_unique_files = enhanced_files - raw_files
if raw_dir_unique_files.count == 0 and enhanced_dir_unique_files.count == 0
puts "No unique files in either directory"
elsif raw_dir_unique_files.count >= 1 and enhanced_dir_unique_files.count == 0
puts "One or more unique files exist in the RAW directory"
puts raw_dir_unique_files
elsif raw_dir_unique_files.count == 0 and enhanced_dir_unique_files.count >= 1
puts "One or more unique files exist in the ENHANCED directory"
puts enhanced_dir_unique_files
elsif raw_dir_unique_files.count >= 1 and enhanced_dir_unique_files.count >= 1
puts "One or more unique files exist in the EACH directory"
puts "RAW"
puts raw_dir_unique_files
puts "ENHANCED"
puts enhanced_dir_unique_files
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment