Improve task which remove consecutive blank lines
This commit is contained in:
parent
d8c497177f
commit
4223769df0
1 changed files with 3 additions and 1 deletions
|
|
@ -13,6 +13,8 @@ namespace :whitespace do
|
||||||
end
|
end
|
||||||
desc 'Remove consecutive blank lines'
|
desc 'Remove consecutive blank lines'
|
||||||
task :scrub_gratuitous_newlines do
|
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
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue