mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 13:46:41 +00:00
19 lines
369 B
Ruby
Executable File
19 lines
369 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
# frozen_string_literal: true
|
|
|
|
ARGV.each do |path|
|
|
print "Checking \"#{path}\"... "
|
|
|
|
unless File.exist?(path)
|
|
puts 'FILE NOT FOUND'
|
|
next
|
|
end
|
|
|
|
checksum = `crc32 "#{path}"`.strip.split(' ', 2).first.upcase
|
|
if File.basename(path).upcase.include?(checksum)
|
|
puts "MATCH (#{checksum})"
|
|
else
|
|
puts "FAIL (#{checksum})"
|
|
end
|
|
end
|