Improve task which remove consecutive blank lines

This commit is contained in:
Dorian 2010-09-26 11:47:05 +02:00 committed by Stephen Caudill
parent d8c497177f
commit 4223769df0

View file

@ -13,6 +13,8 @@ namespace :whitespace do
end
desc 'Remove consecutive blank lines'
task :scrub_gratuitous_newlines do
sh %{find . -name '*.rb' -exec sed -i '' '/./,/^$/!d' {} \\;}
sh %{for f in `find . -type f | grep -v -e '.git/' -e 'public/' -e '.png'`;
do cat $f | sed '/./,/^$/!d' > tmp; cp tmp $f; rm tmp; echo -n .;
done}
end
end