Remove ERB files after upgrading to haml
I converted an application to haml and wanted to get rid of my previous ERb templates.
find ./app/views -name "*.html.erb" -print0 | xargs -0 rm
Explanation
find() ./app/views -name "*.html.erb"returns a list of all ERb view templates.-print0formats the output specially.xargsis a program that takes a list and runs a command for each item in that list.-0means the input format is specially formatted by-print0rmis the command we want to run for each found file
So, each found file will get deleted. Bask in your newfound haml-ness.

Posted by Wes in