Skip to content

Instantly share code, notes, and snippets.

@imtapps
Created January 17, 2013 21:02
Show Gist options
  • Save imtapps/4559714 to your computer and use it in GitHub Desktop.
Save imtapps/4559714 to your computer and use it in GitHub Desktop.
import sys
filenam = sys.argv[-1]
phile = filenam[filenam.rindex('/')+1:].replace('.handlebars', '')
with open(filenam, 'r') as inpt:
allstuff = inpt.read()
superx = "".join(allstuff)
print """var x = "{}"; Ember.TEMPLATES['{}'] = Ember.Handlebars.compile(x);""".format(superx, phile).replace('\n', "")
COMPRESS_PRECOMPILERS = (
('text/coffeescript', 'node_modules/coffee-script/bin/coffee --compile --stdio --bare'),
('text/x-handlebars', 'python doit.py {infile}'),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment