Created
December 20, 2011 14:46
-
-
Save cjweeg/1501794 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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