Skip to content

Instantly share code, notes, and snippets.

@pamelafox
Created May 30, 2012 06:22
Show Gist options
  • Save pamelafox/2834077 to your computer and use it in GitHub Desktop.
Save pamelafox/2834077 to your computer and use it in GitHub Desktop.
Handlebars Folder Renderer Script
import os
input_path = 'application/templates'
output_path = 'application/static/js/templates'
os.system('mkdir %s' % output_path)
dir_list = os.listdir(input_path)
for file_name in dir_list:
if file_name.endswith('.handlebars'):
cmd = 'handlebars %s/%s -f %s/%s' % (input_path, file_name, output_path, file_name.replace('handlebars', 'js'))
print cmd
os.system(cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment