mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-26 02:03:21 +01:00
Add working test implementation of comparing files
This commit is contained in:
parent
2aea8c71ea
commit
6945f42c0c
24
bin/test.rb
Normal file
24
bin/test.rb
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
require "fileutils"
|
||||||
|
require "../lib/trucolor"
|
||||||
|
|
||||||
|
UPSTREAM = "/Home/new-start/dotfiles"
|
||||||
|
|
||||||
|
Dir.glob(ENV["HOME"] + UPSTREAM + "/**/*", File::FNM_DOTMATCH).each do |file|
|
||||||
|
next if File.directory?(file)
|
||||||
|
puts file
|
||||||
|
a = file.sub(UPSTREAM, "")
|
||||||
|
if File.exists?(a) then
|
||||||
|
print "Are the two files identical? "
|
||||||
|
identical = FileUtils.compare_file(file, a)
|
||||||
|
print identical
|
||||||
|
print "\n"
|
||||||
|
|
||||||
|
if not identical and not file.include?(".jpg")
|
||||||
|
puts `grep -nFxvf #{file} #{a}`
|
||||||
|
puts `grep -nFxvf #{a} #{file}`
|
||||||
|
end
|
||||||
|
|
||||||
|
else
|
||||||
|
puts "a did not exist."
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user