Created
March 27, 2015 18:27
-
-
Save SorenPeterson/a83020ec00d7e7d54cea to your computer and use it in GitHub Desktop.
A small ruby script to precompile handlebars file. Note: files must be named with extension .hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
files = `ls` | |
files = files.split("\n") | |
files = files.select do |filename| | |
filename =~ /\A\w+.hbs\z/ | |
end | |
files.each do |filename| | |
new_filename = filename.gsub(/\A(\w+).hbs\z/, '\1.tpl.js') | |
`handlebars #{filename} -f #{new_filename}` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment