mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 07:06:40 +00:00
chore(bin/crc32checker): update for newer ruby versions
This commit is contained in:
@@ -1,14 +1,15 @@
|
|||||||
#! /usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
ARGV.each do |path|
|
ARGV.each do |path|
|
||||||
print "Checking \"#{path}\"... "
|
print "Checking \"#{path}\"... "
|
||||||
|
|
||||||
if !File.exists?(path)
|
unless File.exist?(path)
|
||||||
puts "FILE NOT FOUND"
|
puts 'FILE NOT FOUND'
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
||||||
checksum = `crc32 "#{path}"`.strip.upcase
|
checksum = `crc32 "#{path}"`.strip.split(' ', 2).first.upcase
|
||||||
if File.basename(path).upcase.include?(checksum)
|
if File.basename(path).upcase.include?(checksum)
|
||||||
puts "MATCH (#{checksum})"
|
puts "MATCH (#{checksum})"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user