Last active
February 2, 2016 05:21
-
-
Save christianhujer/9c28c591794581832eda to your computer and use it in GitHub Desktop.
Highlights incoherence in a directory tree.
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
#!/bin/bash | |
startDir=$1 | |
wordToFind=$2 | |
for dir in $(find $startDir -type d) ; do | |
echo -n "$dir:" | |
for file in $(find $dir --depth 1 -name "*.rb") ; do | |
if grep $wordToFind $file >/dev/null ; then | |
echo -n "X" | |
else | |
echo -n "_" | |
fi | |
done | |
echo | |
done | grep -C 9999 X |
markburns
commented
Jan 31, 2016
puts(Dir.glob(ARGV[0]).map do |f|
File.directory?(f) ? "\n#{f} " : (File.read(f)[ARGV[1]] ? "\e[0;31;49mX\e[0m" : ".")
end.join(""))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment