Skip to content

Instantly share code, notes, and snippets.

@stoplion
Created December 8, 2011 22:05
Show Gist options
  • Save stoplion/1448859 to your computer and use it in GitHub Desktop.
Save stoplion/1448859 to your computer and use it in GitHub Desktop.
Bash script to convert Haml to Slim
#!/bin/bash
file_dir='/Users/geoneo/Sites/orion/app/views'
for i in `find ${file_dir} -maxdepth 3 -type f -name "*.haml" ! -empty`
do
output_dir=`dirname $i`
new_file=`basename ${i} | sed 's/\(.*\.\)haml/\1slim/'`
haml2slim ${i} ${output_dir}/${new_file}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment